2019-06-04 05:09:16 +08:00
|
|
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
2015-11-29 00:24:20 +08:00
|
|
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2015-04-09 23:05:16 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-07-08 22:50:13 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2015-11-29 00:24:20 +08:00
|
|
|
//
|
2018-07-22 04:48:07 +08:00
|
|
|
// Edit this file to squeeze more performance, and to customize supported
|
|
|
|
// features
|
2015-11-29 00:24:20 +08:00
|
|
|
//
|
2016-07-08 22:50:13 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2015-04-09 23:05:16 +08:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Under Linux, the much faster CLOCK_REALTIME_COARSE clock can be used.
|
2018-07-22 04:48:07 +08:00
|
|
|
// This clock is less accurate - can be off by dozens of millis - depending on
|
|
|
|
// the kernel HZ.
|
2016-07-08 22:50:13 +08:00
|
|
|
// Uncomment to use it instead of the regular clock.
|
|
|
|
//
|
2015-04-09 23:05:16 +08:00
|
|
|
// #define SPDLOG_CLOCK_COARSE
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2015-05-10 02:35:17 +08:00
|
|
|
// Uncomment if thread id logging is not needed (i.e. no %t in the log pattern).
|
2017-11-26 06:40:47 +08:00
|
|
|
// This will prevent spdlog from querying the thread id on each log call.
|
2016-07-08 22:50:13 +08:00
|
|
|
//
|
2018-07-22 04:48:07 +08:00
|
|
|
// WARNING: If the log pattern contains thread id (i.e, %t) while this flag is
|
|
|
|
// on, the result is undefined.
|
2016-07-08 22:50:13 +08:00
|
|
|
//
|
2015-04-09 23:05:16 +08:00
|
|
|
// #define SPDLOG_NO_THREAD_ID
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-11-26 06:40:47 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2018-11-15 22:42:42 +08:00
|
|
|
// Uncomment to prevent spdlog from using thread local storage.
|
2017-11-26 06:40:47 +08:00
|
|
|
//
|
2018-07-22 04:48:07 +08:00
|
|
|
// WARNING: if your program forks, UNCOMMENT this flag to prevent undefined
|
|
|
|
// thread ids in the children logs.
|
2017-11-26 06:40:47 +08:00
|
|
|
//
|
2018-11-15 22:42:42 +08:00
|
|
|
// #define SPDLOG_NO_TLS
|
2017-11-26 06:40:47 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-04-09 23:05:16 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment if logger name logging is not needed.
|
2018-02-25 09:43:26 +08:00
|
|
|
// This will prevent spdlog from copying the logger name on each log call.
|
2016-07-08 22:50:13 +08:00
|
|
|
//
|
2015-04-09 23:05:16 +08:00
|
|
|
// #define SPDLOG_NO_NAME
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-04-10 06:37:11 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment to avoid spdlog's usage of atomic log levels
|
2018-07-22 04:48:07 +08:00
|
|
|
// Use only if your code never modifies a logger's log levels concurrently by
|
|
|
|
// different threads.
|
2016-07-08 22:50:13 +08:00
|
|
|
//
|
2016-04-10 06:37:11 +08:00
|
|
|
// #define SPDLOG_NO_ATOMIC_LEVELS
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-04-03 11:12:43 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment to enable usage of wchar_t for file names on Windows.
|
2016-07-08 22:50:13 +08:00
|
|
|
//
|
2016-04-10 05:02:19 +08:00
|
|
|
// #define SPDLOG_WCHAR_FILENAMES
|
2016-04-03 11:12:43 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-05-14 03:20:29 +08:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-05-15 06:01:01 +08:00
|
|
|
// Uncomment to override default eol ("\n" or "\r\n" under Linux/Windows)
|
2016-07-22 23:06:36 +08:00
|
|
|
//
|
2016-05-15 05:53:35 +08:00
|
|
|
// #define SPDLOG_EOL ";-)\n"
|
2016-05-14 03:20:29 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-07-22 23:06:36 +08:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment to use your own copy of the fmt library instead of spdlog's copy.
|
2018-07-22 04:48:07 +08:00
|
|
|
// In this case spdlog will try to include <fmt/format.h> so set your -I flag
|
|
|
|
// accordingly.
|
2016-07-22 23:06:36 +08:00
|
|
|
//
|
|
|
|
// #define SPDLOG_FMT_EXTERNAL
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-08-23 01:52:16 +08:00
|
|
|
|
2017-04-01 23:37:16 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment to enable wchar_t support (convert to utf8)
|
|
|
|
//
|
|
|
|
// #define SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-12-10 07:43:43 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-12-10 08:03:13 +08:00
|
|
|
// Uncomment to prevent child processes from inheriting log file descriptors
|
2016-12-10 07:43:43 +08:00
|
|
|
//
|
|
|
|
// #define SPDLOG_PREVENT_CHILD_FD
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2017-04-29 01:25:31 +08:00
|
|
|
|
2017-07-05 08:46:45 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2017-11-25 21:41:55 +08:00
|
|
|
// Uncomment to customize level names (e.g. "MT TRACE")
|
2017-07-05 08:46:45 +08:00
|
|
|
//
|
2018-07-22 04:48:07 +08:00
|
|
|
// #define SPDLOG_LEVEL_NAMES { "MY TRACE", "MY DEBUG", "MY INFO", "MY WARNING",
|
|
|
|
// "MY ERROR", "MY CRITICAL", "OFF" }
|
2017-09-30 03:43:48 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2018-10-12 08:16:22 +08:00
|
|
|
|
2019-02-19 05:33:41 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// 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" }
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-10-12 08:16:22 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment to disable default logger creation.
|
2018-10-12 08:17:51 +08:00
|
|
|
// This might save some (very) small initialization time if no default logger is needed.
|
2018-10-12 08:16:22 +08:00
|
|
|
//
|
|
|
|
// #define SPDLOG_DISABLE_DEFAULT_LOGGER
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2018-11-12 00:15:24 +08:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment and set to compile time level with zero cost (default is INFO).
|
|
|
|
// Macros like SPDLOG_DEBUG(..), SPDLOG_INFO(..) will expand to empty statements if not enabled
|
|
|
|
//
|
|
|
|
// #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO
|
2019-01-09 06:52:40 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Uncomment (and change if desired) macro to use for function names.
|
|
|
|
// This is compiler dependent.
|
|
|
|
// __PRETTY_FUNCTION__ might be nicer in clang/gcc, and __FUNCTION__ in msvc.
|
|
|
|
// Defaults to __FUNCTION__ (should work on all compilers) if not defined.
|
|
|
|
//
|
|
|
|
// #define SPDLOG_FUNCTION __PRETTY_FUNCTION__
|
2019-02-19 05:33:41 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|