Update public source
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
|
||||
def setup_logger():
|
||||
|
||||
|
||||
Path(
|
||||
"logs"
|
||||
).mkdir(
|
||||
exist_ok=True
|
||||
)
|
||||
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
|
||||
|
||||
level=logging.INFO,
|
||||
|
||||
|
||||
format=(
|
||||
|
||||
"%(asctime)s "
|
||||
"[%(levelname)s] "
|
||||
"%(name)s: "
|
||||
"%(message)s"
|
||||
|
||||
),
|
||||
|
||||
|
||||
handlers=[
|
||||
|
||||
|
||||
logging.FileHandler(
|
||||
"logs/project.log"
|
||||
),
|
||||
|
||||
|
||||
logging.StreamHandler()
|
||||
|
||||
]
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
return logging.getLogger(
|
||||
"project-wifi"
|
||||
)
|
||||
Reference in New Issue
Block a user