Skip to content

Commit 039829e

Browse files
refactor(config): use cross-platform app data directory for logs and preferences
- Update LOG_DIR to use get_app_data_dir()/logs - Update PREFER_DIR to use get_app_data_dir()/user_config - Ensures logs and preferences are stored in user-space across Windows, macOS, and Linux
1 parent 1f5f55e commit 039829e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

config/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import os
1212

1313
from config.json_formatter import JsonFormatter
14-
from core.utils import get_persistent_path
14+
from core.utils import get_app_data_dir
1515

1616
# LOG_FILE_PATH = get_absolute_path("../logs/user_activity.log")
17-
LOG_DIR = get_persistent_path("logs")
17+
LOG_DIR = get_app_data_dir() / "logs"
1818

1919
# Ensure the logs directory exists
2020
os.makedirs(LOG_DIR, exist_ok=True)

config/preferences_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import json
88
from pathlib import Path
99

10-
from core.utils import get_persistent_path
10+
from core.utils import get_app_data_dir, get_persistent_path
1111

12-
PREFER_DIR = Path(get_persistent_path("user_config"))
12+
PREFER_DIR = Path(get_app_data_dir() / "user_config")
1313

1414
PREFER_DIR.mkdir(parents=True, exist_ok=True)
1515

0 commit comments

Comments
 (0)