16 lines
381 B
Python
16 lines
381 B
Python
"""示例日志工具。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
|
|
from util.constants import LOG_LOGGER_NAME
|
|
|
|
|
|
def get_logger(name: str | None = None) -> logging.Logger:
|
|
return logging.getLogger(name or LOG_LOGGER_NAME)
|
|
|
|
|
|
def configure_logging(level: int = logging.INFO) -> None:
|
|
logging.basicConfig(level=level, format="%(levelname)s %(name)s %(message)s")
|