tweakme.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. ///////////////////////////////////////////////////////////////////////////////
  5. //
  6. // Edit this file to squeeze more performance, and to customize supported
  7. // features
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. ///////////////////////////////////////////////////////////////////////////////
  11. // Under Linux, the much faster CLOCK_REALTIME_COARSE clock can be used.
  12. // This clock is less accurate - can be off by dozens of millis - depending on
  13. // the kernel HZ.
  14. // Uncomment to use it instead of the regular clock.
  15. //
  16. // #define SPDLOG_CLOCK_COARSE
  17. ///////////////////////////////////////////////////////////////////////////////
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // Uncomment if thread id logging is not needed (i.e. no %t in the log pattern).
  20. // This will prevent spdlog from querying the thread id on each log call.
  21. //
  22. // WARNING: If the log pattern contains thread id (i.e, %t) while this flag is
  23. // on, zero will be logged as thread id.
  24. //
  25. // #define SPDLOG_NO_THREAD_ID
  26. ///////////////////////////////////////////////////////////////////////////////
  27. ///////////////////////////////////////////////////////////////////////////////
  28. // Uncomment to prevent spdlog from using thread local storage.
  29. //
  30. // WARNING: if your program forks, UNCOMMENT this flag to prevent undefined
  31. // thread ids in the children logs.
  32. //
  33. // #define SPDLOG_NO_TLS
  34. ///////////////////////////////////////////////////////////////////////////////
  35. ///////////////////////////////////////////////////////////////////////////////
  36. // Uncomment to avoid spdlog's usage of atomic log levels
  37. // Use only if your code never modifies a logger's log levels concurrently by
  38. // different threads.
  39. //
  40. // #define SPDLOG_NO_ATOMIC_LEVELS
  41. ///////////////////////////////////////////////////////////////////////////////
  42. ///////////////////////////////////////////////////////////////////////////////
  43. // Uncomment to enable usage of wchar_t for file names on Windows.
  44. //
  45. // #define SPDLOG_WCHAR_FILENAMES
  46. ///////////////////////////////////////////////////////////////////////////////
  47. ///////////////////////////////////////////////////////////////////////////////
  48. // Uncomment to override default eol ("\n" or "\r\n" under Linux/Windows)
  49. //
  50. // #define SPDLOG_EOL ";-)\n"
  51. ///////////////////////////////////////////////////////////////////////////////
  52. ///////////////////////////////////////////////////////////////////////////////
  53. // Uncomment to override default folder separators ("/" or "\\/" under
  54. // Linux/Windows). Each character in the string is treated as a different
  55. // separator.
  56. //
  57. // #define SPDLOG_FOLDER_SEPS "\\"
  58. ///////////////////////////////////////////////////////////////////////////////
  59. ///////////////////////////////////////////////////////////////////////////////
  60. // Uncomment to use your own copy of the fmt library instead of spdlog's copy.
  61. // In this case spdlog will try to include <fmt/format.h> so set your -I flag
  62. // accordingly.
  63. //
  64. // #define SPDLOG_FMT_EXTERNAL
  65. ///////////////////////////////////////////////////////////////////////////////
  66. ///////////////////////////////////////////////////////////////////////////////
  67. // Uncomment to use C++20 std::format instead of fmt. This removes compile
  68. // time checking of format strings, but doesn't depend on the fmt library.
  69. //
  70. // #define SPDLOG_USE_STD_FORMAT
  71. ///////////////////////////////////////////////////////////////////////////////
  72. ///////////////////////////////////////////////////////////////////////////////
  73. // Uncomment to enable wchar_t support (convert to utf8)
  74. //
  75. // #define SPDLOG_WCHAR_TO_UTF8_SUPPORT
  76. ///////////////////////////////////////////////////////////////////////////////
  77. ///////////////////////////////////////////////////////////////////////////////
  78. // Uncomment to prevent child processes from inheriting log file descriptors
  79. //
  80. // #define SPDLOG_PREVENT_CHILD_FD
  81. ///////////////////////////////////////////////////////////////////////////////
  82. ///////////////////////////////////////////////////////////////////////////////
  83. // Uncomment to customize level names (e.g. "MY TRACE")
  84. //
  85. // #define SPDLOG_LEVEL_NAMES { "MY TRACE", "MY DEBUG", "MY INFO", "MY WARNING", "MY ERROR", "MY CRITICAL", "OFF" }
  86. ///////////////////////////////////////////////////////////////////////////////
  87. ///////////////////////////////////////////////////////////////////////////////
  88. // Uncomment to customize short level names (e.g. "MT")
  89. // These can be longer than one character.
  90. //
  91. // #define SPDLOG_SHORT_LEVEL_NAMES { "T", "D", "I", "W", "E", "C", "O" }
  92. ///////////////////////////////////////////////////////////////////////////////
  93. ///////////////////////////////////////////////////////////////////////////////
  94. // Uncomment to disable default logger creation.
  95. // This might save some (very) small initialization time if no default logger is needed.
  96. //
  97. // #define SPDLOG_DISABLE_DEFAULT_LOGGER
  98. ///////////////////////////////////////////////////////////////////////////////
  99. ///////////////////////////////////////////////////////////////////////////////
  100. // Uncomment and set to compile time level with zero cost (default is INFO).
  101. // Macros like SPDLOG_DEBUG(..), SPDLOG_INFO(..) will expand to empty statements if not enabled
  102. //
  103. // #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO
  104. ///////////////////////////////////////////////////////////////////////////////
  105. ///////////////////////////////////////////////////////////////////////////////
  106. // Uncomment (and change if desired) macro to use for function names.
  107. // This is compiler dependent.
  108. // __PRETTY_FUNCTION__ might be nicer in clang/gcc, and __FUNCTION__ in msvc.
  109. // Defaults to __FUNCTION__ (should work on all compilers) if not defined.
  110. //
  111. // #ifdef __PRETTY_FUNCTION__
  112. // # define SPDLOG_FUNCTION __PRETTY_FUNCTION__
  113. // #else
  114. // # define SPDLOG_FUNCTION __FUNCTION__
  115. // #endif
  116. ///////////////////////////////////////////////////////////////////////////////