|
|
|
@ -27,8 +27,7 @@ namespace details
|
|
|
|
|
class flag_formatter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual ~flag_formatter()
|
|
|
|
|
{}
|
|
|
|
|
virtual ~flag_formatter() = default;
|
|
|
|
|
virtual void format(details::log_msg& msg, const std::tm& tm_time) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -118,7 +117,6 @@ class B_formatter:public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//write 2 ints separated by sep with padding of 2
|
|
|
|
|
static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, char sep)
|
|
|
|
|
{
|
|
|
|
@ -133,7 +131,6 @@ static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, int v
|
|
|
|
|
return w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Date and time representation (Thu Aug 23 15:35:46 2014)
|
|
|
|
|
class c_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
{
|
|
|
|
@ -144,7 +141,6 @@ class c_formatter SPDLOG_FINAL:public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// year - 2 digit
|
|
|
|
|
class C_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
{
|
|
|
|
@ -154,8 +150,6 @@ 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
|
|
|
|
|
{
|
|
|
|
@ -165,7 +159,6 @@ class D_formatter SPDLOG_FINAL:public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// year - 4 digit
|
|
|
|
|
class Y_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
{
|
|
|
|
@ -281,7 +274,6 @@ class p_formatter SPDLOG_FINAL:public flag_formatter
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 12 hour clock 02:55:02 pm
|
|
|
|
|
class r_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
{
|
|
|
|
@ -315,7 +307,7 @@ class z_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
public:
|
|
|
|
|
const std::chrono::seconds cache_refresh = std::chrono::seconds(5);
|
|
|
|
|
|
|
|
|
|
z_formatter() {}
|
|
|
|
|
z_formatter() = default;
|
|
|
|
|
z_formatter(const z_formatter&) = delete;
|
|
|
|
|
z_formatter& operator=(const z_formatter&) = delete;
|
|
|
|
|
|
|
|
|
@ -363,8 +355,6 @@ private:
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Thread id
|
|
|
|
|
class t_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
{
|
|
|
|
@ -418,8 +408,8 @@ private:
|
|
|
|
|
class aggregate_formatter SPDLOG_FINAL : public flag_formatter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
aggregate_formatter()
|
|
|
|
|
{}
|
|
|
|
|
aggregate_formatter() = default;
|
|
|
|
|
|
|
|
|
|
void add_ch(char ch)
|
|
|
|
|
{
|
|
|
|
|
_str += ch;
|
|
|
|
|