Skip to content

Commit

Permalink
Only change the default logger level if default_logger_level is set
Browse files Browse the repository at this point in the history
Signed-off-by: JafarAbdi <cafer.abdi@gmail.com>
  • Loading branch information
JafarAbdi committed Oct 6, 2021
1 parent 45602bc commit 1393f89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rcl/src/rcl/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1393f89

Please sign in to comment.