Files
AutoGPT-Code-Ability/codex/common/logging.py
T
2024-02-21 11:48:08 +01:00

19 lines
478 B
Python

import logging
from codex.common.logging_config import setup_logging
# This is a custom logger that prints the exception stack trace on error by default
class Logger(logging.Logger):
def __init__(self, name):
super().__init__(name)
def error(self, msg, *args, **kwargs):
if not kwargs.get("exc_info"):
kwargs["exc_info"] = True
super().error(msg, *args, **kwargs)
# def getLogger(name):
# return setup_logging(Logger(name))