You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I still have some questions:
During the execution of the program, I modify the value of the environment variable SPDLOG_LEVEL, and I also have a thread that constantly executes spdlog::cfg::load_env_levels(); Can I use the above method to change the log_level of my spdlog at runtime? Or are there other ways to dynamically adjust the output log_level value during program runtime?
In my current project, I expect to dynamically enable the output of trace-level logs only in some exceptional cases (this log printing has a very high frequency, so I hope to print it only when I need it, in order to avoid the situation of overly large logs), while in normal cases, I expect to only output info-level logs.
The text was updated successfully, but these errors were encountered:
Although spdlog::cfg::load_env_levels() can be called multiple times, operations that update and read environment variables at runtime are not guaranteed to be thread-safe by the C language specification.
If a bug occurs, it is not the responsibility of spdlog.
See: https://stackoverflow.com/a/50479023
Other ways can be implemented freely in your project.
spdlog does not restrict you from calling spdlog::logger::set_level() to change the log level.
I had asked a question earlier:
#3099
But I still have some questions:
During the execution of the program, I modify the value of the environment variable SPDLOG_LEVEL, and I also have a thread that constantly executes spdlog::cfg::load_env_levels(); Can I use the above method to change the log_level of my spdlog at runtime? Or are there other ways to dynamically adjust the output log_level value during program runtime?
In my current project, I expect to dynamically enable the output of trace-level logs only in some exceptional cases (this log printing has a very high frequency, so I hope to print it only when I need it, in order to avoid the situation of overly large logs), while in normal cases, I expect to only output info-level logs.
The text was updated successfully, but these errors were encountered: