-
Notifications
You must be signed in to change notification settings - Fork 430
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
Feature Request: Allow to disable logger by name #2190
Comments
That's a reasonable feature request, but...
This should have worked. It would be interesting to try to dig into it and find out why it didn't work. |
Ok I figured out why setting the level didn't work. I just mixed up two different loggers while copying their names from the log. |
sounds reasonable to me. AFAIS, there are a few ways to do that.
i would prefer to the latter, but there could be more and better approach. i would like to hear from the community. CC: @iuhilnehc-ynos |
I would prefer the second option as this will allow the user to silence a logger even if a component internally resets the log level to something else. |
I would like to work on this (this will be my first PR. I would appreciate any inputs on this. Thanks!) I had a look into the code and on both I think the better approach here is to do something along the lines of first approach. Have a separate map with the Please let me know your thoughts @fujitatomoya @firesurfer |
@cyrus-jackson Sorry that I completely forgot to answer. As I am not familiar with the rclcpp internals I guess @fujitatomoya is the right person to give feedback. |
i think we can change this if we take this path.
this also makes sense and aligns with the logger level management. downside could be performance, if we take this path we need to check 2 hash maps before logging output. the one is for enable hash map and the other is log level hash map. (we can expand the current hash map with log levels, but that could end up with having the same issue.) besides, i believe the main reason to manage the log level in rcutils is to maintain the hierarchy in the process space. (see more details for https://docs.ros.org/en/rolling/Concepts/Intermediate/About-Logging.html#severity-level) i might be missing something, i would like to get more feedbacks. |
In my opinion, given the current design of the logger hierarchy, we should continue to honor that hierarchy. That is, if the logger is disabled, or unset by the user but one of the ancestors is disabled, then we should honor that just like we do for the rest of the levels. That leads me to think that we should just add a new state to the loggers, DISABLED (as mentioned elsewhere). This will be easy to add in, won't add in yet another map, and will honor the hierarchy like everything else does. I agree that the performance won't be great, but it won't be any worse than what we have today. And hopefully if we get ros2/rcutils#427, our logging performance will improve anyway. |
Feature request
Allow to disable a logger by name
Feature description
It would be nice to have a possibility to disable a certain logger completely from code. I have a c++ node which uses moveit internally. Moveit uses a lot of named loggers (e.g. moveit_robot_model.robot_model). As the logging information from some of these loggers is rather irrelevant and distracts from valuable information I would like to completely silence these loggers (at least from the console output) e.g. by calling something like:
What I already tried was to set the logger level to Fatal or Error.
This didn't seem to work. (I would guess moveit sets the log level internally to something else, or there is some other magic happening?)
The text was updated successfully, but these errors were encountered: