1.0.0.8 logging updates
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
|
||||
DEFAULT_LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
|
||||
|
||||
|
||||
def configure_logging(level: int = logging.INFO, fmt: str = DEFAULT_LOG_FORMAT) -> None:
|
||||
"""Configure application logging."""
|
||||
logging.basicConfig(level=level, format=fmt)
|
||||
|
||||
|
||||
def get_logger(name: Optional[str] = None) -> logging.Logger:
|
||||
"""Get a logger by name."""
|
||||
return logging.getLogger(name or __name__)
|
||||
Reference in New Issue
Block a user