File indexing completed on 2025-07-15 09:11:21
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 const std::string spdlog_level_prefix = "SPDLOG_LEVEL=";
0026 for (int i = 1; i < argc; i++) {
0027 std::string arg = argv[i];
0028 if (arg.find(spdlog_level_prefix) == 0) {
0029 auto levels_string = arg.substr(spdlog_level_prefix.size());
0030 helpers::load_levels(levels_string);
0031 }
0032 }
0033 }
0034
0035 inline void load_argv_levels(int argc, char **argv) {
0036 load_argv_levels(argc, const_cast<const char **>(argv));
0037 }
0038
0039 }
0040 }