logger.py
Go to the documentation of this file.
1 import rospy
2 
3 
4 class Logger(object):
5  def __init__(self, module):
6  self.module = module
7 
8  @staticmethod
9  def new_module(module):
10  return Logger(module)
11 
12  def error(self, msg, *args, **kwargs):
13  msg = self._format_msg_(msg, *args, **kwargs)
14  rospy.logerr(msg)
15 
16  def warning(self, msg, *args, **kwargs):
17  msg = self._format_msg_(msg, *args, **kwargs)
18  rospy.logwarn(msg)
19 
20  def info(self, msg, *args, **kwargs):
21  msg = self._format_msg_(msg, *args, **kwargs)
22  rospy.loginfo(msg)
23 
24  def debug(self, msg, *args, **kwargs):
25  msg = self._format_msg_(msg, *args, **kwargs)
26  rospy.logdebug(msg)
27 
28  def _format_msg_(self, msg, *args, **kwargs):
29  msg = msg.format(*args, **kwargs)
30  return '[{0}]: {1}'.format(self.module, msg)
def error(self, msg, args, kwargs)
Definition: logger.py:12
def __init__(self, module)
Definition: logger.py:5
def _format_msg_(self, msg, args, kwargs)
Definition: logger.py:28
def debug(self, msg, args, kwargs)
Definition: logger.py:24
def info(self, msg, args, kwargs)
Definition: logger.py:20
def new_module(module)
Definition: logger.py:9
def warning(self, msg, args, kwargs)
Definition: logger.py:16


ds4_driver
Author(s): Naoki Mizuno
autogenerated on Fri May 1 2020 03:25:46