mirror of https://github.com/gabime/spdlog.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
691 B
C
34 lines
691 B
C
![]()
12 years ago
|
#pragma once
|
||
![]()
11 years ago
|
|
||
![]()
11 years ago
|
#include "details/log_msg.h"
|
||
![]()
11 years ago
|
namespace spitlog
|
||
![]()
12 years ago
|
{
|
||
![]()
11 years ago
|
namespace details {
|
||
|
class flag_formatter;
|
||
|
}
|
||
![]()
12 years ago
|
|
||
|
class formatter
|
||
|
{
|
||
![]()
12 years ago
|
public:
|
||
![]()
11 years ago
|
virtual ~formatter() {}
|
||
![]()
11 years ago
|
virtual void format(details::log_msg& msg) = 0;
|
||
![]()
12 years ago
|
};
|
||
![]()
11 years ago
|
|
||
|
class pattern_formatter : public formatter
|
||
|
{
|
||
|
|
||
|
public:
|
||
|
explicit pattern_formatter(const std::string& pattern);
|
||
|
pattern_formatter(const pattern_formatter&) = delete;
|
||
|
void format(details::log_msg& msg) override;
|
||
|
private:
|
||
|
const std::string _pattern;
|
||
|
std::vector<std::unique_ptr<details::flag_formatter>> _formatters;
|
||
|
void handle_flag(char flag);
|
||
|
void compile_pattern(const std::string& pattern);
|
||
|
};
|
||
![]()
12 years ago
|
}
|
||
![]()
11 years ago
|
|
||
|
#include "./details/pattern_formatter_impl.h"
|
||
|
|