forked from mirakc/mirakc-arib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spdlog.patch
29 lines (28 loc) · 1.14 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
29
diff --git include/spdlog/cfg/env.h include/spdlog/cfg/env.h
index 1f39ebbb..87e3a5f7 100644
--- include/spdlog/cfg/env.h
+++ include/spdlog/cfg/env.h
@@ -25,9 +25,9 @@
namespace spdlog {
namespace cfg {
-inline void load_env_levels()
+inline void load_env_levels(const char *env_var = "SPDLOG_LEVEL")
{
- auto env_val = details::os::getenv("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 b069c3f5..f0e25abe 100644
--- include/spdlog/details/registry.h
+++ include/spdlog/details/registry.h
@@ -97,7 +97,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;
void (*err_handler_)(const std::string &msg) = nullptr;
std::shared_ptr<thread_pool> tp_;