0
$\begingroup$

Rosanswers logo

I searched around on this site, the roscpp/logging page and on the rosconsole wiki page but as far as I can tell there are two obvious ways of changing the logger level and they are:

  1. using rxloggerlevel (maybe through rxconsole too?)
  2. modifying the ROSCONSOLE_CONFIG_FILE

Now, I just found this page, and it told me that using roscpp I can programmatically change the logger level as in rosconsole/examples/example.cpp. So, in writing this question I figured out half of my question but I thought I might as well ask this anyway:

Is there a way to modify the logger level from the command line? Something along the lines of:

roslog {package_name/logger} {logger level}

ex. "roslog sbpl DEBUG" or "roslog sbpl/my_log DEBUG"

Regarding, changing the logger level programmatically, I'll follow the example code and post any questions here if it doesn't work as expected.


Originally posted by ben on ROS Answers with karma: 674 on 2011-08-31

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

@bhaskara's comment answers this ticket, I think. rosservice call is the way to set the logger level, i.e.

 rosservice call $n/set_logger_level $1 $2

It can also be useful to call get_logger_level to determine the possible logger level values.

I personally prefer to do this in rosh as I find it easier to tab-complete and also read the arg specs.

As also noted, this doesn't work for rospy, but I think that's not implied in the original question.


Originally posted by kwc with karma: 12244 on 2011-08-31

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.