From ff194d3e0b0fa64ddaacfb8d65edd8f7cd7dc92f Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Sat, 28 Sep 2024 07:29:05 -0400 Subject: [PATCH] Remove hardcoded nxc_path --- nxc/logger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxc/logger.py b/nxc/logger.py index f551a273..acacfcd4 100755 --- a/nxc/logger.py +++ b/nxc/logger.py @@ -5,6 +5,7 @@ import os.path import sys import re from nxc.console import nxc_console +from nxc.paths import NXC_PATH from termcolor import colored from datetime import datetime from rich.text import Text @@ -194,11 +195,10 @@ class NXCAdapter(logging.LoggerAdapter): @staticmethod def init_log_file(): - newpath = os.path.expanduser("~/.nxc") + "/logs/" + datetime.now().strftime("%Y-%m-%d") - if not os.path.exists(newpath): - os.makedirs(newpath) + newpath = NXC_PATH + "/logs/" + datetime.now().strftime("%Y-%m-%d") + os.makedirs(newpath, exist_ok=True) return os.path.join( - os.path.expanduser("~/.nxc"), + NXC_PATH, "logs", datetime.now().strftime("%Y-%m-%d"), f"log_{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}.log",