Replies: 2 comments 3 replies
-
FYI: There are two ways to change
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Whats wrong in setting this at runtime? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using spdlog in a library, that is supposedly to be used by an external resource, partner or even my other application.
Once the actual application loads this library and tries to execute some of the API calls my library provides, the first call to logging function is invoked.
spdlog::error(error_message);
This by default logs info level and above into the console output.
Since I do not have any visibility on the application or environment, I would prefer if it would be possible to disable the logging level by default.
Technically, there are some static functions in the c++, that can be executed during the DLL is load into memory, however if there would be and error it could crash the entire application and I do not like the approach.
I have found the code, that is responsible for this in the file registry.h
spdlog::level::level_enum global_log_level_ = level::info;
Would it be possible to change this in a similar fashion to use compile time constant as you are doing for SPDLOG_ACTIVE_LEVEL?
Something like
#if !defined(SPDLOG_DEFAULT_LEVEL)
#define SPDLOG_DEFAULT_LEVEL SPDLOG_LEVEL_INFO
#endif
spdlog::level::level_enum global_log_level_ = SPDLOG_DEFAULT_LEVEL;
Beta Was this translation helpful? Give feedback.
All reactions