-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for supporting multiple logging level settings #290
Update for supporting multiple logging level settings #290
Conversation
Signed-off-by: Chen Lihui <[email protected]>
To support multiple logging level settings, there might exist some other ways which could be convenient for users, such as
But to keep consistent with other arguments that using multiple items and use
I wonder if users would like to use the multiple logger level setting as follows,
or just use
I'd like to hear your opinions. |
for user experience, i'd like to go with |
Co-authored-by: tomoya <[email protected]>
@fujitatomoya There are some ways to use
I think I need to hear others' suggestions. |
Option A makes sense if you consider it to be the combination of all specifications given in option B. I think that option B is clearer and easier to parse, though. |
What is the order of precedence if someone gives two different logging levels for a single node? |
the last one wins |
Then the design document must say that. |
Thanks. But I think it's the policy of all arguments, not just for --log-level. So maybe it should not be recorded here. |
If you choose option A then it matters because the argument parser will only see a single argument, and whatever parses that string will need to know what to do. |
After reconsideration, I think I will use option B. (Actually I use option B in the design file). |
@gbiggs |
I am really good to go with either one. |
friendly ping. |
We currently have a lot of inconsistencies on how argument precedence works, I recently opened a PR about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @gbiggs suggested, I think it's good to clarify precedence order.
Using a "last specified argument prevails" rule sounds like a good idea.
This proposal is pretty consistent with how we parse other kinds of arguments, 👍 to that!
I would also like to mention that option C sounds reasonable to me. ros2 run package_name exec_name --ros-args -p param1:=value1,param2:=value2 That would be a much bigger effort that only implementing the new log level arguments. |
@clalancette FYI |
While I have my own personal preferences, I think consistency is more important here. With that in mind, I'd definitely stick with the I would also stick with option B here, as it more closely conforms to what parameters are doing. If we want to expand in the future to support syntax A, we would do it across all of the parameters we support. |
I agree with B, until we want to support something like A everywhere, aka C. |
Co-authored-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Chen Lihui <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth clarifying the precedence in the design article.
Co-authored-by: Ivan Santiago Paunovic <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I only had two nitpick comments that could be addressed or ignored.
|
||
```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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does Some
here mean there are loggers you cannot set this way? If not, I'd drop it. If so, then I think we need some clarification on that.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to have an example that's not just a node, like maybe rclcpp
or talker1.rclcpp
or something more interesting like that.
LGTM |
Signed-off-by: Chen Lihui <[email protected]> Co-authored-by: William Woodall <[email protected]>
Co-authored-by: Ivan Santiago Paunovic <[email protected]>
I'm going to go ahead and merge this with the latest fixes now. Thanks everyone for reviewing this and moving it forward. |
* 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]>
* 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]>
Signed-off-by: Chen Lihui [email protected]