Sha256: a854f5700a4d5d727f1aae31bab5bc29e08c36698804e5273b8748b68b01d45c

Contents?: true

Size: 1022 Bytes

Versions: 24

Compression:

Stored size: 1022 Bytes

Contents

// 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 {
void load_env_levels()
{
    auto env_val = details::os::getenv("SPDLOG_LEVEL");
    auto levels = helpers::extract_levels(env_val);
    details::registry::instance().update_levels(std::move(levels));
}

} // namespace cfg
} // namespace spdlog

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
couchbase-3.0.0-universal-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.beta.1-universal-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.beta.1 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.5-x86_64-linux ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.5-universal-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.5-x86_64-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.5 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.4-x86_64-linux ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.4-x86_64-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.4-universal-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.4 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.3-x86_64-linux ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.3-x86_64-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.3-universal-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.3 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.2-x86_64-linux ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.2-x86_64-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.2-universal-darwin-19 ext/third_party/spdlog/include/spdlog/cfg/env.h
couchbase-3.0.0.alpha.2 ext/third_party/spdlog/include/spdlog/cfg/env.h