mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-14 01:32:07 +08:00
commit
1f3d939009
@ -130,9 +130,9 @@ int main(int, char*[])
|
|||||||
|
|
||||||
// Runtime log levels
|
// Runtime log levels
|
||||||
spd::set_level(spd::level::info); //Set global log level to info
|
spd::set_level(spd::level::info); //Set global log level to info
|
||||||
console->debug("This message shold not be displayed!");
|
console->debug("This message should not be displayed!");
|
||||||
console->set_level(spd::level::debug); // Set specific logger's log level
|
console->set_level(spd::level::debug); // Set specific logger's log level
|
||||||
console->debug("This message shold be displayed..");
|
console->debug("This message should be displayed..");
|
||||||
|
|
||||||
// Compile time log levels
|
// Compile time log levels
|
||||||
// define SPDLOG_DEBUG_ON or SPDLOG_TRACE_ON
|
// define SPDLOG_DEBUG_ON or SPDLOG_TRACE_ON
|
||||||
|
@ -99,7 +99,7 @@ class A_formatter:public flag_formatter
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Abbreviated month
|
//Abbreviated month
|
||||||
static const std::string months[] { "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec" };
|
static const std::string months[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
|
||||||
class b_formatter:public flag_formatter
|
class b_formatter:public flag_formatter
|
||||||
{
|
{
|
||||||
void format(details::log_msg& msg, const std::tm& tm_time) override
|
void format(details::log_msg& msg, const std::tm& tm_time) override
|
||||||
@ -119,14 +119,14 @@ class B_formatter:public flag_formatter
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//write 2 ints seperated by sep with padding of 2
|
//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)
|
static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, char sep)
|
||||||
{
|
{
|
||||||
w << fmt::pad(v1, 2, '0') << sep << fmt::pad(v2, 2, '0');
|
w << fmt::pad(v1, 2, '0') << sep << fmt::pad(v2, 2, '0');
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
//write 3 ints seperated by sep with padding of 2
|
//write 3 ints separated by sep with padding of 2
|
||||||
static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, int v3, char sep)
|
static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, int v3, char sep)
|
||||||
{
|
{
|
||||||
w << fmt::pad(v1, 2, '0') << sep << fmt::pad(v2, 2, '0') << sep << fmt::pad(v3, 2, '0');
|
w << fmt::pad(v1, 2, '0') << sep << fmt::pad(v2, 2, '0') << sep << fmt::pad(v3, 2, '0');
|
||||||
|
@ -154,7 +154,7 @@ void drop_all();
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Trace & Debug can be switched on/off at compile time for zero cost debug statements.
|
// Trace & Debug can be switched on/off at compile time for zero cost debug statements.
|
||||||
// Uncomment SPDLOG_DEBUG_ON/SPDLOG_TRACE_ON in teakme.h to enable.
|
// Uncomment SPDLOG_DEBUG_ON/SPDLOG_TRACE_ON in tweakme.h to enable.
|
||||||
// SPDLOG_TRACE(..) will also print current file and line.
|
// SPDLOG_TRACE(..) will also print current file and line.
|
||||||
//
|
//
|
||||||
// Example:
|
// Example:
|
||||||
|
Loading…
Reference in New Issue
Block a user