fkie_mas_pylib.logging.logging module

class fkie_mas_pylib.logging.logging.Log

Bases: object

Wrapper class for logging events in ROS 1 and 2

static debug(*args) None
static error(*args) None
static fatal(*args) None
static info(*args) None
static set_ros2_logging_node(node) None
static warn(*args) None
class fkie_mas_pylib.logging.logging.LoggingEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Bases: JSONEncoder

default(obj)

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return super().default(o)
fkie_mas_pylib.logging.logging.get_ros_version() int

Returns the current ROS version, returns -1 if not valid ROS found