Skip to content
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

Added feature to enable or disable logs through service call #2256

Open
wants to merge 1 commit into
base: melodic-devel
Choose a base branch
from

Conversation

Lakshay011
Copy link

@Lakshay011 Lakshay011 commented Jul 1, 2022

Issue aimed
Basically right now there is no way to stop logging during the runtime of rospy node ,event though using service call one cannot disable logs, they can only change the log level of the node.
So to overcome this issue I have basically added a feature to enable/disable logs for any rospy node using base service set_logger_level.

Approach
To enable/disable logs, one has to pass enable/disable parameter in logger, part of service request.
Sample Service call to disable logging
rosservice call /node_name/set_logger_level "logger: 'disable' level: 'info'"
This will make sure no logs will get dump.

Moreover the logs will automatically get enable if any other logger is set in service request.
Example:
rosservice call /node_name/set_logger_level "logger: 'rospy' level: 'info'"
or using enable parameter
rosservice call /node_name/set_logger_level "logger: 'enable' level: 'info'"

Future
Once this PR is approved I will raise a PR for roscpp part (already tested & created), so that any node can be disable using service call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant