You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
510 B
Python
20 lines
510 B
Python
import logging
|
|
import os
|
|
|
|
|
|
def setup_logging() -> logging.Logger:
|
|
"""Configure application logging and return the PTZTracker logger."""
|
|
os.makedirs("logs", exist_ok=True)
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s - %(levelname)s - %(message)s",
|
|
handlers=[
|
|
logging.FileHandler("logs/ptz_tracker.log", encoding="utf-8"),
|
|
logging.StreamHandler(),
|
|
],
|
|
)
|
|
return logging.getLogger("PTZTracker")
|
|
|
|
|
|
logger = setup_logging()
|