From 25927ea5f073263e1c7f9947009f22bcaafdf126 Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Sun, 28 Jun 2020 09:53:32 +0800 Subject: [PATCH 1/7] Update for supporting multiple logging level settings Signed-off-by: Chen Lihui --- articles/150_ros_command_line_arguments.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index 437fa0ec7..0b64e332e 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -167,16 +167,24 @@ another_node: string_param: bar ``` -#### Logging level +#### Multiple Logging level assignments -Minimum logging level can be externally set using the `--log-level` option. +Logging level assignments have two means of settings which are a global logging level and other logging levels for specific loggers. Minimum logging level can be externally set using the `--log-level` option. -As an example, to set logging level to `DEBUG` for `some_ros_executable`, one may execute: +As an example, to set a global logging level to `DEBUG` for `some_ros_executable`, one may execute: ```sh ros2 run some_package some_ros_executable --ros-args --log-level DEBUG ``` +Some specific loggers can be set using the `--log-level` option as well, the format as follows: + +```sh +ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN +``` + +Note that the logging level of a specific logger can override the global logging level for this logger. + See `rcutils` and `rcl` logging documentation for reference on existing logging levels. #### External logging configuration From 35231ad09b76240b281d23cc233717c29f3c8fca Mon Sep 17 00:00:00 2001 From: CHEN Date: Mon, 29 Jun 2020 09:29:48 +0800 Subject: [PATCH 2/7] Update articles/150_ros_command_line_arguments.md Co-authored-by: tomoya --- articles/150_ros_command_line_arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index 0b64e332e..d097f800c 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -167,7 +167,7 @@ another_node: string_param: bar ``` -#### Multiple Logging level assignments +#### Multiple logging level assignments Logging level assignments have two means of settings which are a global logging level and other logging levels for specific loggers. Minimum logging level can be externally set using the `--log-level` option. From 982fb1a9f8ffabf6d4dd2b4d9fddf8293658a45a Mon Sep 17 00:00:00 2001 From: CHEN Date: Tue, 30 Jun 2020 09:48:36 +0800 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: Ivan Santiago Paunovic --- articles/150_ros_command_line_arguments.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index d097f800c..542c6f117 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -169,7 +169,7 @@ another_node: #### Multiple logging level assignments -Logging level assignments have two means of settings which are a global logging level and other logging levels for specific loggers. Minimum logging level can be externally set using the `--log-level` option. +Minimum logging level can be externally set either globally or per logger using the `--log-level` option. As an example, to set a global logging level to `DEBUG` for `some_ros_executable`, one may execute: @@ -177,13 +177,13 @@ As an example, to set a global logging level to `DEBUG` for `some_ros_executable ros2 run some_package some_ros_executable --ros-args --log-level DEBUG ``` -Some specific loggers can be set using the `--log-level` option as well, the format as follows: +Some specific loggers can be set using the `--log-level` option as well: ```sh ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN ``` -Note that the logging level of a specific logger can override the global logging level for this logger. +The minimum logging level of a specific logger will override the globally specified minimum logger level. See `rcutils` and `rcl` logging documentation for reference on existing logging levels. From 9a4ec40443ce8cd2f1515ba231411d1fd1b415f8 Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Tue, 30 Jun 2020 09:54:41 +0800 Subject: [PATCH 4/7] Update section name Signed-off-by: Chen Lihui --- articles/150_ros_command_line_arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index 542c6f117..99065b457 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -167,7 +167,7 @@ another_node: string_param: bar ``` -#### Multiple logging level assignments +#### Logging level assignments Minimum logging level can be externally set either globally or per logger using the `--log-level` option. From 8e4d9f06250affb64574c66761ebd893b759bb50 Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Wed, 1 Jul 2020 09:20:06 +0800 Subject: [PATCH 5/7] Update articles/150_ros_command_line_arguments.md Co-authored-by: Ivan Santiago Paunovic --- articles/150_ros_command_line_arguments.md | 1 + 1 file changed, 1 insertion(+) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index 99065b457..96173de73 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -184,6 +184,7 @@ ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG ``` The minimum logging level of a specific logger will override the globally specified minimum logger level. +If a logging level is specified more than once in the passed command line arguments, the last one prevails. See `rcutils` and `rcl` logging documentation for reference on existing logging levels. From 8f98b531ffe04135657db91d8aa10caa1fa39078 Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Thu, 2 Jul 2020 18:04:43 +0800 Subject: [PATCH 6/7] Update for nitpick Signed-off-by: Chen Lihui Co-authored-by: William Woodall --- articles/150_ros_command_line_arguments.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index 96173de73..8742a2e82 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -177,10 +177,10 @@ As an example, to set a global logging level to `DEBUG` for `some_ros_executable ros2 run some_package some_ros_executable --ros-args --log-level DEBUG ``` -Some specific loggers can be set using the `--log-level` option as well: +Loggers can be set using the `--log-level` option as well: ```sh -ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN +ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN rclcpp:=DEBUG ``` The minimum logging level of a specific logger will override the globally specified minimum logger level. From dd04e9434320cbc42805a93eec906195fc9d56dd Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Fri, 3 Jul 2020 09:05:02 +0800 Subject: [PATCH 7/7] Update articles/150_ros_command_line_arguments.md Co-authored-by: Ivan Santiago Paunovic --- articles/150_ros_command_line_arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/150_ros_command_line_arguments.md b/articles/150_ros_command_line_arguments.md index 8742a2e82..968a5b3d7 100644 --- a/articles/150_ros_command_line_arguments.md +++ b/articles/150_ros_command_line_arguments.md @@ -180,7 +180,7 @@ ros2 run some_package some_ros_executable --ros-args --log-level DEBUG Loggers can be set using the `--log-level` option as well: ```sh -ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN rclcpp:=DEBUG +ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN --log-level rclcpp:=DEBUG ``` The minimum logging level of a specific logger will override the globally specified minimum logger level.