diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index b3f12ecd..3b9197cf 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -57,7 +57,6 @@ SPDLOG_API void set_error_handler(void (*handler)(const std::string &msg)); // calls context::shutdown() to perform final cleanups SPDLOG_API void shutdown(); - // API for using global logger (stdout_color_mt), // e.g: spdlog::info("Message {}", 1); // @@ -70,12 +69,15 @@ SPDLOG_API void shutdown(); // // IMPORTANT: // Do not call set_global_logger() from one thread while calling spdlog::info() from another. - SPDLOG_API std::shared_ptr global_logger(); +// Set the global logger. (for example, to replace the global logger with a custom logger) +SPDLOG_API void set_global_logger(std::shared_ptr global_logger); + + +// Return the raw pointer of the global logger SPDLOG_API logger *global_logger_raw(); -SPDLOG_API void set_global_logger(std::shared_ptr global_logger); template void log(source_loc source, level lvl, format_string_t fmt, Args &&...args) {