Update public source

This commit is contained in:
2026-10-10 18:27:24 +03:00
parent 18b2becc7f
commit 71a4143149
2 changed files with 59 additions and 18 deletions
+29 -11
View File
@@ -1,34 +1,52 @@
import logging
from logging.handlers import RotatingFileHandler
from pathlib import Path
def setup_logger():
log_dir = Path(__file__).resolve().parent.parent / "logs"
log_dir.mkdir(
parents=True,
def setup_logger():
Path(
"logs"
).mkdir(
exist_ok=True
)
logging.basicConfig(
level=logging.INFO,
format=(
"%(asctime)s "
"[%(levelname)s] "
"%(name)s: "
"%(message)s"
),
handlers=[
RotatingFileHandler(
log_dir / "project.log",
maxBytes=5 * 1024 * 1024,
backupCount=3,
encoding="utf-8"
logging.FileHandler(
"logs/project.log"
),
logging.StreamHandler()
]
)
return logging.getLogger(
"project-wifi"
)
)