-
Notifications
You must be signed in to change notification settings - Fork 6
/
spdlog.patch
28 lines (27 loc) · 1.11 KB
/
spdlog.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git include/spdlog/cfg/env.h include/spdlog/cfg/env.h
index 6e554145..10a44dc5 100644
--- include/spdlog/cfg/env.h
+++ include/spdlog/cfg/env.h
@@ -25,8 +25,8 @@
namespace spdlog {
namespace cfg {
-inline void load_env_levels() {
- auto env_val = details::os::getenv("SPDLOG_LEVEL");
+inline void load_env_levels(const char *env_var = "SPDLOG_LEVEL") {
+ auto env_val = details::os::getenv(env_var);
if (!env_val.empty()) {
helpers::load_levels(env_val);
}
diff --git include/spdlog/details/registry.h include/spdlog/details/registry.h
index 56a6886e..9f08fe47 100644
--- include/spdlog/details/registry.h
+++ include/spdlog/details/registry.h
@@ -104,7 +104,7 @@ private:
std::unordered_map<std::string, std::shared_ptr<logger>> loggers_;
log_levels log_levels_;
std::unique_ptr<formatter> formatter_;
- spdlog::level::level_enum global_log_level_ = level::info;
+ spdlog::level::level_enum global_log_level_ = level::off; // compatible with env_logger in Rust
level::level_enum flush_level_ = level::off;
err_handler err_handler_;
std::shared_ptr<thread_pool> tp_;