diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-16 01:12:59 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-16 01:12:59 +0100 |
commit | 082f3893215797268d7ac8c1000ebe371f276af7 (patch) | |
tree | b5cc677a49635a9244559e235d4915c064c9f6c4 /NorthstarDLL/include/spdlog/cfg/argv.h | |
parent | b30a385fc25dad05e568ae8538f5aa3656c5c8d4 (diff) | |
download | NorthstarLauncher-082f3893215797268d7ac8c1000ebe371f276af7.tar.gz NorthstarLauncher-082f3893215797268d7ac8c1000ebe371f276af7.zip |
lots of stuff idk
Diffstat (limited to 'NorthstarDLL/include/spdlog/cfg/argv.h')
-rw-r--r-- | NorthstarDLL/include/spdlog/cfg/argv.h | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/NorthstarDLL/include/spdlog/cfg/argv.h b/NorthstarDLL/include/spdlog/cfg/argv.h index ebf90876..36d9f1c4 100644 --- a/NorthstarDLL/include/spdlog/cfg/argv.h +++ b/NorthstarDLL/include/spdlog/cfg/argv.h @@ -1,44 +1,44 @@ -// 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>
-
-//
-// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="
-//
-// set all loggers to debug level:
-// example.exe "SPDLOG_LEVEL=debug"
-
-// set logger1 to trace level
-// example.exe "SPDLOG_LEVEL=logger1=trace"
-
-// turn off all logging except for logger1 and logger2:
-// example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info"
-
-namespace spdlog {
-namespace cfg {
-
-// search for SPDLOG_LEVEL= in the args and use it to init the levels
-inline void load_argv_levels(int argc, const char **argv)
-{
- const std::string spdlog_level_prefix = "SPDLOG_LEVEL=";
- for (int i = 1; i < argc; i++)
- {
- std::string arg = argv[i];
- if (arg.find(spdlog_level_prefix) == 0)
- {
- auto levels_string = arg.substr(spdlog_level_prefix.size());
- helpers::load_levels(levels_string);
- }
- }
-}
-
-inline void load_argv_levels(int argc, char **argv)
-{
- load_argv_levels(argc, const_cast<const char **>(argv));
-}
-
-} // namespace cfg
-} // namespace spdlog
+// 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> + +// +// Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" +// +// set all loggers to debug level: +// example.exe "SPDLOG_LEVEL=debug" + +// set logger1 to trace level +// example.exe "SPDLOG_LEVEL=logger1=trace" + +// turn off all logging except for logger1 and logger2: +// example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" + +namespace spdlog { +namespace cfg { + +// search for SPDLOG_LEVEL= in the args and use it to init the levels +inline void load_argv_levels(int argc, const char **argv) +{ + const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; + for (int i = 1; i < argc; i++) + { + std::string arg = argv[i]; + if (arg.find(spdlog_level_prefix) == 0) + { + auto levels_string = arg.substr(spdlog_level_prefix.size()); + helpers::load_levels(levels_string); + } + } +} + +inline void load_argv_levels(int argc, char **argv) +{ + load_argv_levels(argc, const_cast<const char **>(argv)); +} + +} // namespace cfg +} // namespace spdlog |