feat: store packaged user data under data directory
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ import traceback
|
||||
|
||||
from . import appconfig
|
||||
|
||||
DEFAULT_LOG_DIR = "logs"
|
||||
DEFAULT_LOG_DIR = appconfig.diagnostic_log_dir()
|
||||
DEFAULT_LOG_FILE = "cmshopee.log"
|
||||
DEFAULT_MAX_BYTES = 2 * 1024 * 1024
|
||||
DEFAULT_BACKUPS = 3
|
||||
@@ -115,4 +115,4 @@ def _rotate_if_needed(path, max_bytes=DEFAULT_MAX_BYTES, backups=DEFAULT_BACKUPS
|
||||
target = f"{path}.{index + 1}"
|
||||
if os.path.exists(source):
|
||||
os.replace(source, target)
|
||||
os.replace(path, f"{path}.1")
|
||||
os.replace(path, f"{path}.1")
|
||||
|
||||
Reference in New Issue
Block a user