implement a flag (in this case, an enumeration) that allows control over the type; we make it an enum for possible expansions of time abstractions that might make it into the C++ standard in the future (see Howard Hinnant's date/timezone library) or might be usefully-available from the OS at some point in time

This commit is contained in:
ThePhD
2017-05-30 18:05:25 -04:00
parent 13fb2550c6
commit 5c5080d304
7 changed files with 49 additions and 17 deletions

View File

@@ -66,7 +66,7 @@ public:
void set_level(level::level_enum);
level::level_enum level() const;
const std::string& name() const;
void set_pattern(const std::string&);
void set_pattern(const std::string&, pattern_time = pattern_time::local);
void set_formatter(formatter_ptr);
// automatically call flush() if message level >= log_level
@@ -82,7 +82,7 @@ public:
protected:
virtual void _sink_it(details::log_msg&);
virtual void _set_pattern(const std::string&);
virtual void _set_pattern(const std::string&, pattern_time);
virtual void _set_formatter(formatter_ptr);
// default error handler: print the error to stderr with the max rate of 1 message/minute