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
  • Loading branch information
JafarAbdi committed Oct 6, 2021
1 parent 45602bc commit fff32b6
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 fff32b6

Please sign in to comment.