diff --git a/src/modalities/utils/logging.py b/src/modalities/utils/logging.py new file mode 100644 index 00000000..47f9c779 --- /dev/null +++ b/src/modalities/utils/logging.py @@ -0,0 +1,11 @@ +import logging + + +def get_logger(name: str = "main") -> logging.Logger: + logger = logging.getLogger(name) + if not logger.handlers: + logger.setLevel(logging.DEBUG) + handler = logging.StreamHandler() + handler.setFormatter(logging.Formatter("%(name)s - %(levelname)s - %(message)s")) + logger.addHandler(handler) + return logger