|
|
|
@ -116,7 +116,7 @@ class B_formatter : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Date and time representation (Thu Aug 23 15:35:46 2014)
|
|
|
|
|
class c_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class c_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -142,7 +142,7 @@ class c_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// year - 2 digit
|
|
|
|
|
class C_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class C_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -151,7 +151,7 @@ class C_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Short MM/DD/YY date, equivalent to %m/%d/%y 08/23/01
|
|
|
|
|
class D_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class D_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -164,7 +164,7 @@ class D_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// year - 4 digit
|
|
|
|
|
class Y_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class Y_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -173,7 +173,7 @@ class Y_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// month 1-12
|
|
|
|
|
class m_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class m_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -182,7 +182,7 @@ class m_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// day of month 1-31
|
|
|
|
|
class d_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class d_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -191,7 +191,7 @@ class d_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// hours in 24 format 0-23
|
|
|
|
|
class H_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class H_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -200,7 +200,7 @@ class H_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// hours in 12 format 1-12
|
|
|
|
|
class I_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class I_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -209,7 +209,7 @@ class I_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// minutes 0-59
|
|
|
|
|
class M_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class M_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -218,7 +218,7 @@ class M_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// seconds 0-59
|
|
|
|
|
class S_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class S_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -227,7 +227,7 @@ class S_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// milliseconds
|
|
|
|
|
class e_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class e_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -237,7 +237,7 @@ class e_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// microseconds
|
|
|
|
|
class f_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class f_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -247,7 +247,7 @@ class f_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// nanoseconds
|
|
|
|
|
class F_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class F_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -257,7 +257,7 @@ class F_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// seconds since epoch
|
|
|
|
|
class E_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class E_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -268,7 +268,7 @@ class E_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// AM/PM
|
|
|
|
|
class p_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class p_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -277,7 +277,7 @@ class p_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 12 hour clock 02:55:02 pm
|
|
|
|
|
class r_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class r_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -292,7 +292,7 @@ class r_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 24-hour HH:MM time, equivalent to %H:%M
|
|
|
|
|
class R_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class R_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -303,7 +303,7 @@ class R_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ISO 8601 time format (HH:MM:SS), equivalent to %H:%M:%S
|
|
|
|
|
class T_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class T_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -318,7 +318,7 @@ class T_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ISO 8601 offset from UTC in timezone (+-HH:MM)
|
|
|
|
|
class z_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class z_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const std::chrono::seconds cache_refresh = std::chrono::seconds(5);
|
|
|
|
@ -371,7 +371,7 @@ private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Thread id
|
|
|
|
|
class t_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class t_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -380,7 +380,7 @@ class t_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Current pid
|
|
|
|
|
class pid_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class pid_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -389,7 +389,7 @@ class pid_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// message counter formatter
|
|
|
|
|
class i_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class i_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -397,7 +397,7 @@ class i_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class v_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class v_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -405,7 +405,7 @@ class v_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ch_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class ch_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit ch_formatter(char ch)
|
|
|
|
@ -422,7 +422,7 @@ private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// aggregate user chars to display as is
|
|
|
|
|
class aggregate_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class aggregate_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
aggregate_formatter() = default;
|
|
|
|
@ -441,14 +441,14 @@ private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// mark the color range. expect it to be in the form of "%^colored text%$"
|
|
|
|
|
class color_start_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class color_start_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
|
msg.color_range_start = dest.size();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
class color_stop_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class color_stop_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -458,7 +458,7 @@ class color_stop_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
|
|
|
|
|
// Full info formatter
|
|
|
|
|
// pattern: [%Y-%m-%d %H:%M:%S.%e] [%n] [%l] %v
|
|
|
|
|
class full_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
class full_formatter final : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &tm_time, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
@ -528,7 +528,7 @@ private:
|
|
|
|
|
|
|
|
|
|
} // namespace details
|
|
|
|
|
|
|
|
|
|
class pattern_formatter SPDLOG_FINAL : public formatter
|
|
|
|
|
class pattern_formatter final : public formatter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit pattern_formatter(
|
|
|
|
|