mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Added SPDLOG_DISABLE_DEFAULT_LOGGER option to tweakme.h
This commit is contained in:
parent
b368d18b0f
commit
312fe4775d
@ -28,7 +28,6 @@ void clone_example();
|
||||
|
||||
int main(int, char *[])
|
||||
{
|
||||
|
||||
spdlog::info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH);
|
||||
spdlog::warn("Easy padding in numbers like {:08d}", 12);
|
||||
spdlog::critical("Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42);
|
||||
|
@ -215,15 +215,20 @@ private:
|
||||
registry()
|
||||
: formatter_(new pattern_formatter("%+"))
|
||||
{
|
||||
// create default logger (stdout_color_mt).
|
||||
|
||||
#ifndef SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||
// create default logger (ansicolor_stdout_sink_mt or wincolor_stdout_sink_mt in windows).
|
||||
#ifdef _WIN32
|
||||
auto color_sink = std::make_shared<sinks::wincolor_stdout_sink_mt>();
|
||||
#else
|
||||
auto color_sink = std::make_shared<sinks::ansicolor_stdout_sink_mt>();
|
||||
#endif
|
||||
SPDLOG_CONSTEXPR const char *default_logger_name = "";
|
||||
|
||||
const char *default_logger_name = "";
|
||||
default_logger_ = std::make_shared<spdlog::logger>(default_logger_name, std::move(color_sink));
|
||||
loggers_[default_logger_name] = default_logger_;
|
||||
|
||||
#endif // SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||
}
|
||||
|
||||
~registry() = default;
|
||||
|
@ -121,3 +121,11 @@
|
||||
// #define SPDLOG_LEVEL_NAMES { "MY TRACE", "MY DEBUG", "MY INFO", "MY WARNING",
|
||||
// "MY ERROR", "MY CRITICAL", "OFF" }
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Uncomment to disable default logger creation.
|
||||
// This might save some small initialization time
|
||||
//
|
||||
// #define SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user