From 3a40f0c34df6be58ec9044ac5faf1663e835f281 Mon Sep 17 00:00:00 2001 From: Asit Kumar Dhal Date: Wed, 5 Jul 2017 02:46:45 +0200 Subject: [PATCH] fixed length and upper case log level tags --- include/spdlog/common.h | 5 ++++- include/spdlog/tweakme.h | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index fdfe7bcb..7e352fa0 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -81,7 +81,10 @@ typedef enum off = 6 } level_enum; -static const char* level_names[] { "trace", "debug", "info", "warning", "error", "critical", "off" }; +#if !defined(SPDLOG_LEVEL_NAMES) +#define SPDLOG_LEVEL_NAMES { "trace", "debug", "info", "warning", "error", "critical", "off" }; +#endif +static const char* level_names[] SPDLOG_LEVEL_NAMES static const char* short_level_names[] { "T", "D", "I", "W", "E", "C", "O" }; diff --git a/include/spdlog/tweakme.h b/include/spdlog/tweakme.h index d1b63c06..53f5cf7e 100644 --- a/include/spdlog/tweakme.h +++ b/include/spdlog/tweakme.h @@ -132,3 +132,10 @@ // // #define SPDLOG_ENABLE_MESSAGE_COUNTER /////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Uncomment to enable user defined tag names +// +// #define SPDLOG_LEVEL_NAMES { " TRACE", " DEBUG", " INFO", +// " WARNING", " ERROR", "CRITICAL", "OFF" }; +/////////////////////////////////////////////////////////////////////////////// \ No newline at end of file