18 std::cout <<
"Starting logging example with short macros..." << std::endl;
21 LOGIT_ADD_CONSOLE_DEFAULT();
22 LOGIT_ADD_FILE_LOGGER_DEFAULT();
23 LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE();
26 LOG_I(
"Info message using short macro");
29 LOG_W_PRINT(
"Warning message with color: ",
COLORS::RED);
30 LOG_WP(
"Warning message with color: ",
COLORS::RED);
33 LOG_W_PRINTF(
"Warning message with color: %d",
static_cast<int>(
COLORS::RED));
34 LOG_WPF(
"Warning message with color: %d",
static_cast<int>(
COLORS::RED));
38 LOG_WF(
"%.4d",
static_cast<int>(
COLORS::RED), temp);
41 LOG_E_PRINT(
"Error message with float value: ", 42.42f);
42 LOG_EP(
"Error message with float value: ", 42.42f);
44 const int error_code = 404;
45 LOG_F(
"Fatal error message", error_code);
48 LOG_S_INFO() <<
"Stream-based info logging with short macro. Integer value: " << 123;
49 LOG_S_WARN() <<
"Stream-based warning with color: " <<
COLORS::GREEN;
52 LOG_S_TRACE_TO(UNIQUE_LOGGER_ID) <<
"Trace logging to unique file with short macro";
55 LOG_IPF(
"Formatted info log: float=%.2f, int=%d", 3.14, 42);
56 LOG_E_PRINTF(
"Formatted error log: value=%d", 100);
61 std::cout <<
"Logging example with short macros completed." << std::endl;