INNER CODE UNIT · Python
_ShortNameFormatter
416rehman/DeepZero · src/deepzero/cli.py:56
class _ShortNameFormatter(logging.Formatter):
# strips deepzero prefix to keep log lines short and scannable
def format(self, record: logging.LogRecord) -> str:
name = record.name
short = _LOG_PREFIX_MAP.get(name)
if short is None:
if name.startswith("deepzero.processor."):
short = name[len("deepzero.processor.") :]
elif name.startswith("deepzero."):
short = name[len("deepzero.") :]
else:
short = name
# force silence third-party stacktraces completely
if not name.startswith("deepzero."):
record.exc_info = None
record.exc_text = None