18 lines
410 B
Python
18 lines
410 B
Python
|
|
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}")
|