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.
spdlog/include/c11log/formatter.h

34 lines
690 B
C

12 years ago
#pragma once
11 years ago
#include "details/log_msg.h"
12 years ago
namespace c11log
{
11 years ago
namespace details {
class flag_formatter;
}
12 years ago
class formatter
{
12 years ago
public:
virtual ~formatter() {}
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"