|
|
|
@ -356,7 +356,7 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Thread id
|
|
|
|
|
// Thread id
|
|
|
|
|
class t_formatter:public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(details::log_msg& msg, const std::tm&) override
|
|
|
|
@ -365,6 +365,15 @@ class t_formatter:public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Current pid
|
|
|
|
|
class pid_formatter:public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(details::log_msg& msg, const std::tm&) override
|
|
|
|
|
{
|
|
|
|
|
msg.formatted << details::os::pid();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class v_formatter:public flag_formatter
|
|
|
|
|
{
|
|
|
|
@ -453,6 +462,8 @@ class full_formatter:public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
@ -611,6 +622,10 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
|
|
|
|
|
_formatters.push_back(std::unique_ptr<details::flag_formatter>(new details::full_formatter()));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ('P'):
|
|
|
|
|
_formatters.push_back(std::unique_ptr<details::flag_formatter>(new details::pid_formatter()));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default: //Unkown flag appears as is
|
|
|
|
|
_formatters.push_back(std::unique_ptr<details::flag_formatter>(new details::ch_formatter('%')));
|
|
|
|
|
_formatters.push_back(std::unique_ptr<details::flag_formatter>(new details::ch_formatter(flag)));
|
|
|
|
|