mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2026-02-13 00:37:33 +01:00
Adding log information to events
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import platform
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
from platform_utils import paths as paths_
|
||||
|
||||
from functools import wraps
|
||||
@@ -9,6 +10,8 @@ from functools import wraps
|
||||
mode = None
|
||||
directory = None
|
||||
|
||||
log = logging.getLogger("paths")
|
||||
|
||||
def merge_paths(func):
|
||||
@wraps(func)
|
||||
def merge_paths_wrapper(*a):
|
||||
@@ -28,6 +31,7 @@ def config_path():
|
||||
elif mode == "installed":
|
||||
path = data_path("config")
|
||||
if not os.path.exists(path):
|
||||
log.debug("%s path does not exist, creating..." % (path,))
|
||||
os.mkdir(path)
|
||||
return path
|
||||
|
||||
@@ -40,6 +44,7 @@ def logs_path():
|
||||
elif mode == "installed":
|
||||
path = data_path("logs")
|
||||
if not os.path.exists(path):
|
||||
log.debug("%s path does not exist, creating..." % (path,))
|
||||
os.mkdir(path)
|
||||
return path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user