mirror of
https://github.com/marcogll/telegram_expenses_controller.git
synced 2026-01-14 04:55:28 +00:00
feat: Implement core application structure, AI extraction, persistence, and Telegram bot modules with updated configuration and dependencies.
This commit is contained in:
28
app/audit/logs.py
Normal file
28
app/audit/logs.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Logging configuration and handlers.
|
||||
"""
|
||||
import logging
|
||||
import sys
|
||||
from app.config import config
|
||||
|
||||
def setup_logging():
|
||||
"""
|
||||
Sets up a centralized logging configuration for the application.
|
||||
"""
|
||||
log_level = config.LOG_LEVEL.upper()
|
||||
|
||||
# Remove any existing handlers
|
||||
for handler in logging.root.handlers[:]:
|
||||
logging.root.removeHandler(handler)
|
||||
|
||||
logging.basicConfig(
|
||||
level=log_level,
|
||||
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
||||
stream=sys.stdout
|
||||
)
|
||||
logging.getLogger("sqlalchemy.engine").setLevel(logging.WARNING)
|
||||
logging.getLogger("uvicorn.access").setLevel(logging.WARNING)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info(f"Logging configured with level {log_level}")
|
||||
|
||||
Reference in New Issue
Block a user