Ask Your Question

Revision history [back]

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
// instead of rospy.core use node name?
logger = logging.getLogger("rospy.core")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get '20' for rospy.core

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
// # instead of rospy.core use node name?
logger = logging.getLogger("rospy.core")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get '20' for rospy.core

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
# instead of rospy.core use node name?
logger = logging.getLogger("rospy.core")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get '20' for rospy.core

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
# instead of rospy.core use node name?
logger = logging.getLogger("rospy.core")
logging.getLogger("rosout")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get '20' for rospy.core

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
# instead of rospy.core use node name?
logger = logging.getLogger("rosout")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get '20' for rospy.core

I'll update these with more information as I try it out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
logger = logging.getLogger("rosout")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get '20' 20 for rospy.core
INFO, 10 for debug

This uses the python logging (https://docs.python.org/2.4/lib/module-logging.html) underneath rospy logging:

#!/usr/bin/env python

import rospy
import logging

rospy.init_node('log_test')

logger = logging.getLogger("rosout")

logger.setLevel(logging.INFO)
level = logger.getEffectiveLevel()
rospy.loginfo("info level " + str(level))
rospy.logdebug("info level " + str(level))

logger.setLevel(logging.DEBUG)
level = logger.getEffectiveLevel()
rospy.loginfo("info level " + str(level))
rospy.logdebug("debug level " + str(level))

Old suggestions, maybe I'll update these with more information as I try it test them out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Or something like this?

import logging
logger = logging.getLogger("rosout")
level = logger.getEffectiveLevel()
# TODO how to interpret level- I get 20 for INFO, 10 for debug

This uses the python logging (https://docs.python.org/2.4/lib/module-logging.html) underneath rospy logging:

#!/usr/bin/env python

import rospy
import logging

rospy.init_node('log_test')

logger = logging.getLogger("rosout")

logger.setLevel(logging.INFO)
level = logger.getEffectiveLevel()
rospy.loginfo("info level " + str(level))
rospy.logdebug("info level " + str(level))

logger.setLevel(logging.DEBUG)
level = logger.getEffectiveLevel()
rospy.loginfo("info level " + str(level))
rospy.logdebug("debug level " + str(level))

Old suggestions, maybe I'll test them out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Answer: yes it does run the function regardless of whether it is needed.

This uses the python logging (https://docs.python.org/2.4/lib/module-logging.html) underneath rospy logging:

#!/usr/bin/env python

import rospy
import logging

rospy.init_node('log_test')

logger = logging.getLogger("rosout")

logger.setLevel(logging.INFO)
level = logger.getEffectiveLevel()
rospy.loginfo("info test, level = " + str(level))
rospy.logdebug("info rospy.logdebug("debug test, level = level " + str(level))

logger.setLevel(logging.DEBUG)
level = logger.getEffectiveLevel()
rospy.loginfo("info test, level = " + str(level))
rospy.logdebug("debug test, level = level " + str(level))

Old suggestions, maybe I'll test them out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does this actually execute the stats generation if log level is not debug? (Would it in C++ also?)

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Answer: yes it does run the function regardless of whether it is needed.

This uses the python logging (https://docs.python.org/2.4/lib/module-logging.html) underneath rospy logging:

#!/usr/bin/env python

import rospy
import logging

rospy.init_node('log_test')

logger = logging.getLogger("rosout")

logger.setLevel(logging.INFO)
level = logger.getEffectiveLevel()
rospy.loginfo("info test, level = " + str(level))
rospy.logdebug("debug test, level = level " + str(level))

logger.setLevel(logging.DEBUG)
level = logger.getEffectiveLevel()
rospy.loginfo("info test, level = " + str(level))
rospy.logdebug("debug test, level = level " + str(level))

Old suggestions, maybe I'll test them out:

rospy service call to get_loggers service. (Maybe some extra things to do to properly call service from same node that is providing it)

Or does I don't think there is anything in python like a C macro that could avoid evaluating a function parameter if debug wasn't on (does the actual C++ debug do anything like that?), it would be nice if this actually execute the stats generation if log level is not debug? (Would it in C++ also?)could be done:

rospy.logdebug("Very informative output: %s",  burdensome_stats_generation())

Answer: yes it does run the function regardless of whether it is needed.