rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
|
Logger wrapper with support for throttling logged messages per call site. More...
Public Member Functions | |
__init__ (self, logger) | |
Creates a wrapper logger around given logger instance, providing support for throttling. | |
debug (self, msg, *args, **kwargs) | |
Logs `msg % args` with severity `DEBUG`. | |
error (self, msg, *args, **kwargs) | |
Logs `msg % args` with severity `ERROR`. | |
fatal (self, msg, *args, **kwargs) | |
Logs `msg % args` with severity `FATAL`. | |
info (self, msg, *args, **kwargs) | |
Logs `msg % args` with severity `INFO`. | |
log (self, level, msg, *args, **kwargs) | |
Logs `msg % args` with given severity. | |
warn (self, msg, *args, **kwargs) | |
Logs `msg % args` with severity `WARNING`. | |
warning (self, msg, *args, **kwargs) | |
Logs `msg % args` with severity `WARN`. | |
Protected Member Functions | |
_extract_args (cls, kwargs) | |
Drops throttle parameters from kwargs and returns as dict. | |
_is_throttled (cls, msg, once=False, throttle=None, throttle_identical=False) | |
Returns whether message should be skipped. | |
Static Protected Attributes | |
dict | _HASHES |
Caller IDs and log message hashes for throttling by identical text. | |
list | _KEYWORDS |
_ONCES | |
Caller IDs registered for throttling by once-only. | |
dict | _TIMES |
Caller IDs and last timestamps for throttling by time. | |
Logger wrapper with support for throttling logged messages per call site.
Logging methods (`debug()`, `info()`, etc) accept additional keyword arguments:
rosros.util.ThrottledLogger.__init__ | ( | self, | |
logger | |||
) |
|
protected |
|
protected |
rosros.util.ThrottledLogger.debug | ( | self, | |
msg, | |||
* | args, | ||
** | kwargs | ||
) |
Logs `msg % args` with severity `DEBUG`.
To pass exception information, use the keyword argument `exc_info=True`.
__once__ | whether to log only once from call site |
__throttle__ | seconds to skip logging from call site for |
__throttle_identical__ | whether to skip identical consecutive texts from call site |
rosros.util.ThrottledLogger.error | ( | self, | |
msg, | |||
* | args, | ||
** | kwargs | ||
) |
rosros.util.ThrottledLogger.fatal | ( | self, | |
msg, | |||
* | args, | ||
** | kwargs | ||
) |
rosros.util.ThrottledLogger.info | ( | self, | |
msg, | |||
* | args, | ||
** | kwargs | ||
) |
rosros.util.ThrottledLogger.log | ( | self, | |
level, | |||
msg, | |||
* | args, | ||
** | kwargs | ||
) |
rosros.util.ThrottledLogger.warn | ( | self, | |
msg, | |||
* | args, | ||
** | kwargs | ||
) |
rosros.util.ThrottledLogger.warning | ( | self, | |
msg, | |||
* | args, | ||
** | kwargs | ||
) |
|
staticprotected |
|
staticprotected |
|
staticprotected |