From d8817fdd24c33b5e02786663f804a6240746c751 Mon Sep 17 00:00:00 2001 From: Jafar Abdi Date: Thu, 28 Oct 2021 22:46:13 +0400 Subject: [PATCH] Only change the default logger level if default_logger_level is set (#943) Signed-off-by: JafarAbdi --- rcl/src/rcl/logging.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rcl/src/rcl/logging.c b/rcl/src/rcl/logging.c index c1aebc75e..77f6a5e11 100644 --- a/rcl/src/rcl/logging.c +++ b/rcl/src/rcl/logging.c @@ -74,8 +74,10 @@ rcl_logging_configure_with_output_handler( g_rcl_logging_num_out_handlers = 0; if (log_levels) { - default_level = (int)log_levels->default_logger_level; - rcutils_logging_set_default_logger_level(default_level); + if (log_levels->default_logger_level != RCUTILS_LOG_SEVERITY_UNSET) { + default_level = (int)log_levels->default_logger_level; + rcutils_logging_set_default_logger_level(default_level); + } for (size_t i = 0; i < log_levels->num_logger_settings; ++i) { rcutils_ret_t rcutils_status = rcutils_logging_set_logger_level(