We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f47ebb3 commit ff194d3Copy full SHA for ff194d3
1 file changed
nxc/logger.py
@@ -5,6 +5,7 @@
5
import sys
6
import re
7
from nxc.console import nxc_console
8
+from nxc.paths import NXC_PATH
9
from termcolor import colored
10
from datetime import datetime
11
from rich.text import Text
@@ -194,11 +195,10 @@ def add_file_log(self, log_file=None):
194
195
196
@staticmethod
197
def init_log_file():
- newpath = os.path.expanduser("~/.nxc") + "/logs/" + datetime.now().strftime("%Y-%m-%d")
198
- if not os.path.exists(newpath):
199
- os.makedirs(newpath)
+ newpath = NXC_PATH + "/logs/" + datetime.now().strftime("%Y-%m-%d")
+ os.makedirs(newpath, exist_ok=True)
200
return os.path.join(
201
- os.path.expanduser("~/.nxc"),
+ NXC_PATH,
202
"logs",
203
datetime.now().strftime("%Y-%m-%d"),
204
f"log_{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}.log",
0 commit comments