Skip to content

Commit 3d8af83

Browse files
Chen Lihuifujitatomoyaivanpaunowjwwood
authored andcommitted
Update for supporting multiple logging level settings (ros2#290)
* Update for supporting multiple logging level settings Signed-off-by: Chen Lihui <[email protected]> Co-authored-by: tomoya <[email protected]> Co-authored-by: Ivan Santiago Paunovic <[email protected]> Co-authored-by: William Woodall <[email protected]>
1 parent 45d3091 commit 3d8af83

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

articles/150_ros_command_line_arguments.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,25 @@ another_node:
167167
string_param: bar
168168
```
169169

170-
#### Logging level
170+
#### Logging level assignments
171171

172-
Minimum logging level can be externally set using the `--log-level` option.
172+
Minimum logging level can be externally set either globally or per logger using the `--log-level` option.
173173

174-
As an example, to set logging level to `DEBUG` for `some_ros_executable`, one may execute:
174+
As an example, to set a global logging level to `DEBUG` for `some_ros_executable`, one may execute:
175175

176176
```sh
177177
ros2 run some_package some_ros_executable --ros-args --log-level DEBUG
178178
```
179179

180+
Loggers can be set using the `--log-level` option as well:
181+
182+
```sh
183+
ros2 run some_package some_ros_executable --ros-args --log-level talker1:=DEBUG --log-level talker2:=WARN --log-level rclcpp:=DEBUG
184+
```
185+
186+
The minimum logging level of a specific logger will override the globally specified minimum logger level.
187+
If a logging level is specified more than once in the passed command line arguments, the last one prevails.
188+
180189
See `rcutils` and `rcl` logging documentation for reference on existing logging levels.
181190

182191
#### External logging configuration

0 commit comments

Comments
 (0)