Update public source

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