🔧 fix(manager.py): change logger.warn to logger.warning for consistency and clarity

🔧 fix(logger.py): change log_file parameter type annotation to Optional[Path] to indicate that it is an optional argument
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-04 16:15:41 -03:00
commit 28b487dc33
2 changed files with 3 additions and 2 deletions

View file

@ -89,7 +89,7 @@ class DatabaseManager(Service):
for table in legacy_tables:
if table in inspector.get_table_names():
logger.warn(f"Legacy table exists: {table}")
logger.warning(f"Legacy table exists: {table}")
return True

View file

@ -1,9 +1,10 @@
from typing import Optional
from loguru import logger
from pathlib import Path
from rich.logging import RichHandler
def configure(log_level: str = "DEBUG", log_file: Path = None):
def configure(log_level: str = "DEBUG", log_file: Optional[Path] = None):
log_format = "<green>{time:HH:mm:ss}</green> - <level>{level: <8}</level> - <level>{message}</level>"
logger.remove() # Remove default handlers