From 6e3d1761ae827582550468d7b23edd6ec333175e Mon Sep 17 00:00:00 2001 From: JeanElsner Date: Sat, 25 Nov 2023 05:01:50 +0100 Subject: [PATCH] Remove log filter --- src/dm_robotics/panda/utils.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/dm_robotics/panda/utils.py b/src/dm_robotics/panda/utils.py index 083e12b..7d54143 100644 --- a/src/dm_robotics/panda/utils.py +++ b/src/dm_robotics/panda/utils.py @@ -64,24 +64,6 @@ def format(self, record: logging.LogRecord) -> str: return msg -class DuplicateFilter(logging.Filter): - """Filters duplicate for a given dead time.""" - - def __init__(self, dead_time: float = 5.0) -> None: - self._dead_time = dead_time - - def filter(self, record: logging.LogRecord): - # add other fields if you need more granular comparison, depends on your app - current_log = (record.module, record.levelno, record.msg) - if current_log != getattr(self, '_last_log', - None) or record.created - getattr( - self, '_last_created', 0) > self._dead_time: - self._last_log = current_log - self._last_created = record.created - return True - return False - - def init_logging() -> None: """Set the standard log format and handler.""" for h in logging.root.handlers[:]: @@ -90,7 +72,6 @@ def init_logging() -> None: handler = logging.StreamHandler() handler.setFormatter( Formatter('[%(asctime)s][%(name)s] %(message)s', '%Y-%m-%d %H:%M:%S')) - handler.addFilter(DuplicateFilter()) logging.root.setLevel(logging.INFO) logging.root.addHandler(handler) logging.captureWarnings(True)