File indexing completed on 2025-01-30 10:24:42
0001
0002
0003
0004 #pragma once
0005 #include <spdlog/cfg/helpers.h>
0006 #include <spdlog/details/registry.h>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 namespace spdlog {
0021 namespace cfg {
0022
0023
0024 inline void load_argv_levels(int argc, const char **argv)
0025 {
0026 const std::string spdlog_level_prefix = "SPDLOG_LEVEL=";
0027 for (int i = 1; i < argc; i++)
0028 {
0029 std::string arg = argv[i];
0030 if (arg.find(spdlog_level_prefix) == 0)
0031 {
0032 auto levels_string = arg.substr(spdlog_level_prefix.size());
0033 helpers::load_levels(levels_string);
0034 }
0035 }
0036 }
0037
0038 inline void load_argv_levels(int argc, char **argv)
0039 {
0040 load_argv_levels(argc, const_cast<const char **>(argv));
0041 }
0042
0043 }
0044 }