Simplifying the shared library compatible global set_default_logger

pull/2200/head
Sean Farrell 4 years ago
parent 7d2b9f3f3e
commit 372c2a6295

@ -137,7 +137,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
# Static/Shared library (shared not supported in windows yet) # Static/Shared library (shared not supported in windows yet)
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
set(SPDLOG_SRCS src/spdlog.cpp src/stdout_sinks.cpp src/color_sinks.cpp src/file_sinks.cpp src/registry.cpp src/async.cpp src/cfg.cpp) set(SPDLOG_SRCS src/spdlog.cpp src/stdout_sinks.cpp src/color_sinks.cpp src/file_sinks.cpp src/async.cpp src/cfg.cpp)
if(NOT SPDLOG_USE_STD_FORMAT AND NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO) if(NOT SPDLOG_USE_STD_FORMAT AND NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
list(APPEND SPDLOG_SRCS src/fmt.cpp) list(APPEND SPDLOG_SRCS src/fmt.cpp)

@ -289,12 +289,14 @@ SPDLOG_INLINE void registry::set_levels(log_levels levels, level::level_enum *gl
} }
#ifndef SPDLOG_COMPILED_LIB #ifndef SPDLOG_COMPILED_LIB
SPDLOG_INLINE registry &registry::instance() SPDLOG_INLINE
#endif
registry &registry::instance()
{ {
static registry s_instance; static registry s_instance;
return s_instance; return s_instance;
} }
#endif
SPDLOG_INLINE void registry::throw_if_exists_(const std::string &logger_name) SPDLOG_INLINE void registry::throw_if_exists_(const std::string &logger_name)
{ {

@ -1,20 +0,0 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#ifndef SPDLOG_COMPILED_LIB
# error Please define SPDLOG_COMPILED_LIB to compile this file.
#endif
#include <spdlog/details/registry.h>
namespace spdlog {
namespace details {
registry &registry::instance()
{
static registry s_instance;
return s_instance;
}
}
}
Loading…
Cancel
Save