Files
wehub-resource-sync 925e56bb5f
Unit tests / build (t4_gpu) (push) Has been cancelled
Unit tests / build (ubuntu-latest) (push) Has been cancelled
Unit tests / build (windows-latest) (push) Has been cancelled
Test CLI scripts / build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:56 +08:00

28 lines
733 B
Python

import logging
import warnings
from surya.settings import settings
def configure_logging():
logger = get_logger()
# Remove any existing handlers to prevent duplicates
for handler in logger.handlers[:]:
logger.removeHandler(handler)
# Add our handler
handler = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
# Prevent propagation to parent loggers to avoid double logging
logger.propagate = False
logger.setLevel(settings.LOGLEVEL)
warnings.simplefilter(action="ignore", category=FutureWarning)
def get_logger():
return logging.getLogger("surya")