added logging
This commit is contained in:
17
tempbox/src/modules/tempbox_logger.py
Normal file
17
tempbox/src/modules/tempbox_logger.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
log_dir = Path.home() / ".local" / "share" / "tempbox"
|
||||
log_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
log_file = log_dir / "tempbox.log"
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG,
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
filename=log_file,
|
||||
)
|
||||
|
||||
logger = logging.getLogger()
|
||||
logger.debug(f"Log path:\t{log_dir}")
|
||||
logger.debug(f"Log file:\t{log_file}")
|
||||
Reference in New Issue
Block a user