From 0365131b0fb70ce89ad2960395d99e72084c2ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:54:00 +0100 Subject: [PATCH] CONFIG LOADING WIP --- nano/lib/logging.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nano/lib/logging.cpp b/nano/lib/logging.cpp index 3822cf7d7c..b8e1236652 100644 --- a/nano/lib/logging.cpp +++ b/nano/lib/logging.cpp @@ -337,6 +337,14 @@ std::map nano::log_config::defa nano::log_config nano::load_log_config (nano::log_config fallback, const std::filesystem::path & data_path, const std::vector & config_overrides) { const std::string config_filename = "config-log.toml"; - auto config = nano::load_config_file (fallback, config_filename, data_path, config_overrides); - return config; + try + { + auto config = nano::load_config_file (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; } \ No newline at end of file