mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Merge pull request #996 from MFornander/v1.x
Add tweak support for user short level names
This commit is contained in:
commit
bdfc7d2a5a
@ -125,9 +125,12 @@ enum level_enum
|
|||||||
"trace", "debug", "info", "warning", "error", "critical", "off" \
|
"trace", "debug", "info", "warning", "error", "critical", "off" \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
|
static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
|
||||||
static const char *short_level_names[]{"T", "D", "I", "W", "E", "C", "O"};
|
|
||||||
|
#if !defined(SPDLOG_SHORT_LEVEL_NAMES)
|
||||||
|
#define SPDLOG_SHORT_LEVEL_NAMES {"T", "D", "I", "W", "E", "C", "O"}
|
||||||
|
#endif
|
||||||
|
static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES;
|
||||||
|
|
||||||
inline string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
|
inline string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
|
||||||
{
|
{
|
||||||
|
@ -121,6 +121,13 @@
|
|||||||
// "MY ERROR", "MY CRITICAL", "OFF" }
|
// "MY ERROR", "MY CRITICAL", "OFF" }
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Uncomment to customize short level names (e.g. "MT")
|
||||||
|
// These can be longer than one character.
|
||||||
|
//
|
||||||
|
// #define SPDLOG_SHORT_LEVEL_NAMES { "T", "D", "I", "W", "E", "C", "O" }
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Uncomment to disable default logger creation.
|
// Uncomment to disable default logger creation.
|
||||||
// This might save some (very) small initialization time if no default logger is needed.
|
// This might save some (very) small initialization time if no default logger is needed.
|
||||||
|
Loading…
Reference in New Issue
Block a user