|
|
@@ -29,6 +29,7 @@ enum class value_token |
|
|
|
systime, //!< unix timestamp |
|
|
|
runtime, //!< runtime of the application |
|
|
|
sender, //!< sender of the log message |
|
|
|
sender_type, //!< type of sender |
|
|
|
thread, //!< thread id |
|
|
|
filename, //!< filename only |
|
|
|
filepath, //!< whole filepath |
|
|
@@ -106,18 +107,19 @@ struct invariant_string_map |
|
|
|
}; |
|
|
|
|
|
|
|
static invariant_string_map value_token_map({ |
|
|
|
{ "level", value_token::level }, |
|
|
|
{ "uptime", value_token::uptime }, |
|
|
|
{ "systime", value_token::systime }, |
|
|
|
{ "runtime", value_token::runtime }, |
|
|
|
{ "sender", value_token::sender }, |
|
|
|
{ "thread", value_token::thread }, |
|
|
|
{ "filename", value_token::filename }, |
|
|
|
{ "filepath", value_token::filepath }, |
|
|
|
{ "line", value_token::line }, |
|
|
|
{ "name", value_token::name }, |
|
|
|
{ "message", value_token::message }, |
|
|
|
{ "newline", value_token::newline }, |
|
|
|
{ "level", value_token::level }, |
|
|
|
{ "uptime", value_token::uptime }, |
|
|
|
{ "systime", value_token::systime }, |
|
|
|
{ "runtime", value_token::runtime }, |
|
|
|
{ "sender", value_token::sender }, |
|
|
|
{ "sender_type", value_token::sender_type }, |
|
|
|
{ "thread", value_token::thread }, |
|
|
|
{ "filename", value_token::filename }, |
|
|
|
{ "filepath", value_token::filepath }, |
|
|
|
{ "line", value_token::line }, |
|
|
|
{ "name", value_token::name }, |
|
|
|
{ "message", value_token::message }, |
|
|
|
{ "newline", value_token::newline }, |
|
|
|
}); |
|
|
|
|
|
|
|
consumer::format_type consumer::parse_format(const std::string& format) |
|
|
@@ -576,6 +578,12 @@ void consumer::write_formatted(const log_entry& e, const format_type& f, std::os |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
/* sender_type */ |
|
|
|
case value_token::sender_type: |
|
|
|
has_line_end = false; |
|
|
|
os << e.sender_type; |
|
|
|
break; |
|
|
|
|
|
|
|
/* thread */ |
|
|
|
case value_token::thread: |
|
|
|
has_line_end = false; |
|
|
|