Skip to content

Commit

Permalink
fix: parsing cli-arg for logger config file
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
  • Loading branch information
xDimon committed Sep 30, 2024
1 parent 4176004 commit eefcf8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/application/impl/app_configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ namespace kagome::application {
desc.add_options()
("help,h", "show this help message")
("version,v", "show version information")
("logcfg", po::value<std::string>(), "optional, path to config file of logger")
("logcfg", po::value<std::string>(), "optional, path to logger config file")
("log,l", po::value<std::vector<std::string>>(),
"Sets a custom logging filter. Syntax is `<target>=<level>`, e.g. -llibp2p=off.\n"
"Log levels (most to least verbose) are trace, debug, verbose, info, warn, error, critical, off. By default, all targets log `info`.\n"
Expand Down
3 changes: 2 additions & 1 deletion core/log/configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ namespace kagome::log {
po::options_description desc("General options");
desc.add_options()
// clang-format off
("logcfg", po::value<std::string>(), "optional, path to logging config file")
("logcfg", po::value<std::string>())
("log", po::value<std::string>()) // needed to avoid mix `--logcfg` and `--log`
// clang-format on
;

Expand Down
2 changes: 1 addition & 1 deletion node/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int main(int argc, const char **argv, const char **env) {
if (custom_log_config_path.has_value()) {
if (not std::filesystem::is_regular_file(
custom_log_config_path.value())) {
std::cerr << "Provided wrong path to config file of logging\n";
std::cerr << "Provided wrong path to logger config file\n";
exit(EXIT_FAILURE);
}
}
Expand Down

0 comments on commit eefcf8e

Please sign in to comment.