Skip to content

Commit

Permalink
CONFIG LOADING WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 16, 2024
1 parent f0693f7 commit 0365131
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nano/lib/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,14 @@ std::map<nano::log_config::logger_id_t, nano::log::level> nano::log_config::defa
nano::log_config nano::load_log_config (nano::log_config fallback, const std::filesystem::path & data_path, const std::vector<std::string> & config_overrides)
{
const std::string config_filename = "config-log.toml";
auto config = nano::load_config_file<nano::log_config> (fallback, config_filename, data_path, config_overrides);
return config;
try
{
auto config = nano::load_config_file<nano::log_config> (fallback, config_filename, data_path, config_overrides);
return config;
}
catch (std::runtime_error const & ex)
{
std::cerr << "Unable to load log config. Using defaults. Error: " << ex.what () << std::endl;
}
return fallback;
}

0 comments on commit 0365131

Please sign in to comment.