Skip to content

Commit ff194d3

Browse files
committed
Remove hardcoded nxc_path
1 parent f47ebb3 commit ff194d3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

nxc/logger.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
import re
77
from nxc.console import nxc_console
8+
from nxc.paths import NXC_PATH
89
from termcolor import colored
910
from datetime import datetime
1011
from rich.text import Text
@@ -194,11 +195,10 @@ def add_file_log(self, log_file=None):
194195

195196
@staticmethod
196197
def init_log_file():
197-
newpath = os.path.expanduser("~/.nxc") + "/logs/" + datetime.now().strftime("%Y-%m-%d")
198-
if not os.path.exists(newpath):
199-
os.makedirs(newpath)
198+
newpath = NXC_PATH + "/logs/" + datetime.now().strftime("%Y-%m-%d")
199+
os.makedirs(newpath, exist_ok=True)
200200
return os.path.join(
201-
os.path.expanduser("~/.nxc"),
201+
NXC_PATH,
202202
"logs",
203203
datetime.now().strftime("%Y-%m-%d"),
204204
f"log_{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}.log",

0 commit comments

Comments
 (0)