diff --git a/src/spdlog.cpp b/src/spdlog.cpp index 85296782..47539524 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT License (http://opensource.org/licenses/MIT) #include +#include #include "spdlog/spdlog.h" #include "spdlog/common.h" @@ -30,7 +31,10 @@ void set_global_logger(std::shared_ptr global_logger) { context()->set_logger(std::move(global_logger)); } -logger *global_logger_raw() noexcept { return context_ref()->global_logger_raw(); } +logger *global_logger_raw() noexcept { + assert(context_ref()->global_logger_raw() != nullptr); + return context_ref()->global_logger_raw(); +} void set_formatter(std::unique_ptr formatter) { global_logger()->set_formatter(std::move(formatter));