diff options
author | F1F7Y <64418963+F1F7Y@users.noreply.github.com> | 2023-06-30 03:10:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-29 21:10:24 -0400 |
commit | 71f0ee98ccc85d41ba7587d122c83011ab1e25c3 (patch) | |
tree | c362337bedb5d341c3f063e9a0b4840fb8b8ba2c /thirdparty/spdlog/cfg/env.h | |
parent | efd907105cf7906c78253631f75bf4fd83f769db (diff) | |
download | NorthstarLauncher-71f0ee98ccc85d41ba7587d122c83011ab1e25c3.tar.gz NorthstarLauncher-71f0ee98ccc85d41ba7587d122c83011ab1e25c3.zip |
Reorganize third-party dependencies into `thirdparty` directory (#491)
* rename `include` to `thirdparty`
* remove duplicate minhook in wsock32
* move minhook into its own directory
* move openssl lib into separate directories
Diffstat (limited to 'thirdparty/spdlog/cfg/env.h')
-rw-r--r-- | thirdparty/spdlog/cfg/env.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/thirdparty/spdlog/cfg/env.h b/thirdparty/spdlog/cfg/env.h new file mode 100644 index 00000000..1f39ebbb --- /dev/null +++ b/thirdparty/spdlog/cfg/env.h @@ -0,0 +1,38 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once +#include <spdlog/cfg/helpers.h> +#include <spdlog/details/registry.h> +#include <spdlog/details/os.h> + +// +// Init levels and patterns from env variables SPDLOG_LEVEL +// Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). +// Note - fallback to "info" level on unrecognized levels +// +// Examples: +// +// set global level to debug: +// export SPDLOG_LEVEL=debug +// +// turn off all logging except for logger1: +// export SPDLOG_LEVEL="*=off,logger1=debug" +// + +// turn off all logging except for logger1 and logger2: +// export SPDLOG_LEVEL="off,logger1=debug,logger2=info" + +namespace spdlog { +namespace cfg { +inline void load_env_levels() +{ + auto env_val = details::os::getenv("SPDLOG_LEVEL"); + if (!env_val.empty()) + { + helpers::load_levels(env_val); + } +} + +} // namespace cfg +} // namespace spdlog |