Spaces:
Running
Running
File size: 543 Bytes
5cc1949 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
"""Generalized logging utility"""
import logging
from enum import IntEnum
logging.basicConfig(
level=logging.INFO, format="%(asctime)s %(message)s", datefmt="%H:%M:%S"
)
_internal_logger = logging.getLogger("GenAI For Audio")
_internal_logger.setLevel(logging.INFO)
class LogLevels(IntEnum):
"""Logging levels to show trace"""
OFF = 0
ON = 1
def log(message, log_level: LogLevels = LogLevels.ON):
"""Generalized custom logger"""
if log_level > LogLevels.OFF:
_internal_logger.log(logging.INFO, message)
|