mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 10:29:02 +08:00
Added apply_logger_env_levels
(#2649)
This method applies levels which is set by environment variable `SPDLOG_LEVEL` to the a single controller. Usefull for loading configuration into manually created loggers.
This commit is contained in:
@@ -131,6 +131,15 @@ SPDLOG_API spdlog::logger *default_logger_raw();
|
||||
|
||||
SPDLOG_API void set_default_logger(std::shared_ptr<spdlog::logger> default_logger);
|
||||
|
||||
// Initialize logger level based on environment configs.
|
||||
//
|
||||
// Useful for applying SPDLOG_LEVEL to manually created loggers.
|
||||
//
|
||||
// Example:
|
||||
// auto mylogger = std::make_shared<spdlog::logger>("mylogger", ...);
|
||||
// spdlog::apply_logger_env_levels(mylogger);
|
||||
SPDLOG_API void apply_logger_env_levels(std::shared_ptr<logger> logger);
|
||||
|
||||
template<typename... Args>
|
||||
inline void log(source_loc source, level::level_enum lvl, format_string_t<Args...> fmt, Args &&... args)
|
||||
{
|
||||
|
Reference in New Issue
Block a user