Skip to content

Commit c62d9df

Browse files
committed
Fix example LOG macros
1 parent ec7e192 commit c62d9df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/logger.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <chrono>
55
#include <format>
66

7-
#define LOG_DEBUG(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[DEBUG] " << std::format(fmt, __VA_ARGS__) << std::endl
8-
#define LOG_INFO(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[INFO] " << std::format(fmt, __VA_ARGS__) << std::endl
9-
#define LOG_WARN(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[WARNING] " << std::format(fmt, __VA_ARGS__) << std::endl
10-
#define LOG_ERROR(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[ERROR] " << std::format(fmt, __VA_ARGS__) << std::endl
11-
#define LOG_TRACE(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[TRACE] " << std::format(fmt, __VA_ARGS__) << std::endl
7+
#define LOG_DEBUG(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[DEBUG] " << std::format(fmt __VA_OPT__(,) __VA_ARGS__) << std::endl
8+
#define LOG_INFO(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[INFO] " << std::format(fmt __VA_OPT__(,) __VA_ARGS__) << std::endl
9+
#define LOG_WARN(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[WARNING] " << std::format(fmt __VA_OPT__(,) __VA_ARGS__) << std::endl
10+
#define LOG_ERROR(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[ERROR] " << std::format(fmt __VA_OPT__(,) __VA_ARGS__) << std::endl
11+
#define LOG_TRACE(fmt, ...) std::cout << std::format("{:%Y-%m-%d %H:%M:%S} ", std::chrono::system_clock::now()) << "[TRACE] " << std::format(fmt __VA_OPT__(,) __VA_ARGS__) << std::endl

0 commit comments

Comments
 (0)