mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-01 02:49:03 +08:00
use if statement instead of switch (changes of adding new time specifications outside of standard are probably unlikely anyhow)
pattern_time -> pattern_time_type ptime variable name -> pattern_time variable name make sure four spaces used, not tabs
This commit is contained in:
@@ -29,16 +29,17 @@ class pattern_formatter SPDLOG_FINAL : public formatter
|
||||
{
|
||||
|
||||
public:
|
||||
explicit pattern_formatter(const std::string& pattern, pattern_time ptime = pattern_time::local);
|
||||
explicit pattern_formatter(const std::string& pattern, pattern_time_type pattern_time = pattern_time_type::local);
|
||||
pattern_formatter(const pattern_formatter&) = delete;
|
||||
pattern_formatter& operator=(const pattern_formatter&) = delete;
|
||||
void format(details::log_msg& msg) override;
|
||||
private:
|
||||
const std::string _pattern;
|
||||
const pattern_time _time;
|
||||
const pattern_time_type _pattern_time;
|
||||
std::vector<std::unique_ptr<details::flag_formatter>> _formatters;
|
||||
std::tm get_time(details::log_msg& msg);
|
||||
void handle_flag(char flag);
|
||||
void compile_pattern(const std::string& pattern, pattern_time ptime);
|
||||
void compile_pattern(const std::string& pattern);
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user