diff --git a/nano/lib/logging_enums.hpp b/nano/lib/logging_enums.hpp index 79f4df8dec..7392320bc8 100644 --- a/nano/lib/logging_enums.hpp +++ b/nano/lib/logging_enums.hpp @@ -75,6 +75,7 @@ enum class type rep_tiers, syn_cookies, thread_runner, + signal_manager, // bootstrap bulk_pull_client, diff --git a/nano/lib/signal_manager.cpp b/nano/lib/signal_manager.cpp index d84fe153a1..b6075f81a3 100644 --- a/nano/lib/signal_manager.cpp +++ b/nano/lib/signal_manager.cpp @@ -46,14 +46,16 @@ void nano::signal_manager::register_signal_handler (int signum, std::functionclear (); } - - descriptor.sigman.log (boost::str (boost::format ("Signal processed: %d") % signum)); } else { - descriptor.sigman.log (boost::str (boost::format ("Signal error: %d (%s)") % error.value () % error.message ())); + logger.debug (nano::log::type::signal_manager, "Signal error: {} ({})", ec.message (), to_signal_name (signum)); } } diff --git a/nano/lib/signal_manager.hpp b/nano/lib/signal_manager.hpp index 926fe7296f..333861be3a 100644 --- a/nano/lib/signal_manager.hpp +++ b/nano/lib/signal_manager.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -51,18 +52,14 @@ class signal_manager final bool repeat; }; - /** - * Logging function of signal manager. It does nothing at the moment, it throws away the log. - * I expect to revisit this in the future. It also makes it easy to manually introduce logs, if needed temporarily. - */ - void log (std::string const &){}; - /** * This is the actual handler that is registered with boost asio. * It calls the caller supplied function (if one is given) and sets the handler to repeat (or not). */ static void base_handler (nano::signal_manager::signal_descriptor descriptor, boost::system::error_code const & error, int signum); + nano::logger logger; + /** boost asio context to use */ boost::asio::io_context ioc;