This commit is contained in:
2026-01-25 13:20:58 -06:00
parent 3884abc695
commit 2d9aba7e04
37 changed files with 0 additions and 0 deletions

21
email-worker/logger.py Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""
Structured logging for email worker
"""
import threading
from datetime import datetime
def log(message: str, level: str = 'INFO', worker_name: str = 'unified-worker'):
"""
Structured logging with timestamp and thread info
Args:
message: Log message
level: Log level (INFO, WARNING, ERROR, SUCCESS)
worker_name: Name of the worker component
"""
timestamp = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
thread_name = threading.current_thread().name
print(f"[{timestamp}] [{level}] [{worker_name}] [{thread_name}] {message}", flush=True)