mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 17:24:45 +00:00
refactor: simplify log file initialization by consolidating directory and file creation.
This commit is contained in:
@@ -25,11 +25,8 @@ readonly LOG_FILE="${HOME}/.config/mole/mole.log"
|
||||
readonly DEBUG_LOG_FILE="${HOME}/.config/mole/mole_debug_session.log"
|
||||
readonly LOG_MAX_SIZE_DEFAULT=1048576 # 1MB
|
||||
|
||||
# Ensure log directory exists
|
||||
ensure_user_dir "$(dirname "$LOG_FILE")"
|
||||
if is_root_user && [[ -n "${SUDO_USER:-}" && "${SUDO_USER:-}" != "root" ]]; then
|
||||
ensure_user_file "$LOG_FILE"
|
||||
fi
|
||||
# Ensure log directory and file exist with correct ownership
|
||||
ensure_user_file "$LOG_FILE"
|
||||
|
||||
# ============================================================================
|
||||
# Log Rotation
|
||||
|
||||
Reference in New Issue
Block a user