mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
path update for log files
This commit is contained in:
parent
f293722cda
commit
84eb027241
|
@ -218,13 +218,13 @@ app.whenReady().then(() => {
|
|||
|
||||
if(os.platform()=='win32' || os.platform()=='win64'){
|
||||
// for windows the relative path via path.join(__dirname) is not needed for some reason
|
||||
//daemonProcess = exec('\\tnc\\daemon.exe', [])
|
||||
|
||||
daemonProcess = exec('\\tnc\\daemon.exe', [])
|
||||
/*
|
||||
daemonProcess = exec(path.join(process.resourcesPath, 'tnc', 'daemon.exe'), [],
|
||||
{
|
||||
cwd: path.join(process.resourcesPath, 'tnc'),
|
||||
});
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
// return process messages
|
||||
|
|
|
@ -290,19 +290,21 @@ if __name__ == '__main__':
|
|||
PARSER.add_argument('--port', dest="socket_port",default=3001, help="Socket port", type=int)
|
||||
ARGS = PARSER.parse_args()
|
||||
static.DAEMONPORT = ARGS.socket_port
|
||||
|
||||
try:
|
||||
if sys.platform == 'linux':
|
||||
logging_path = os.getenv("HOME") + '/.config/' + 'FreeDATA/' + 'daemon'
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
logging_path = os.getenv("HOME") + '/.config/' + 'FreeDATA/' + 'daemon'
|
||||
logging_path = os.getenv("HOME") + '/Library/' + 'Application Support' + 'FreeDATA/' + 'daemon'
|
||||
|
||||
if sys.platform == 'win32' or sys.platform == 'win64':
|
||||
logging_path = os.getenv('APPDATA') + '/' + 'FreeDATA/' + 'daemon'
|
||||
|
||||
if not os.path.exists(logging_path):
|
||||
os.makedirs(logging_path)
|
||||
log_handler.setup_logging(logging_path)
|
||||
|
||||
|
||||
except:
|
||||
structlog.get_logger("structlog").error("[TNC] logger init error")
|
||||
|
||||
try:
|
||||
structlog.get_logger("structlog").info("[DMN] Starting TCP/IP socket", port=static.DAEMONPORT)
|
||||
|
|
11
tnc/main.py
11
tnc/main.py
|
@ -18,6 +18,7 @@ import structlog
|
|||
import log_handler
|
||||
import modem
|
||||
import sys
|
||||
import os
|
||||
import signal
|
||||
import time
|
||||
import multiprocessing
|
||||
|
@ -89,18 +90,22 @@ if __name__ == '__main__':
|
|||
import sock
|
||||
|
||||
# config logging
|
||||
|
||||
|
||||
try:
|
||||
if sys.platform == 'linux':
|
||||
logging_path = os.getenv("HOME") + '/.config/' + 'FreeDATA/' + 'tnc'
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
logging_path = os.getenv("HOME") + '/.config/' + 'FreeDATA/' + 'tnc'
|
||||
logging_path = os.getenv("HOME") + '/Library/' + 'Application Support' + 'FreeDATA/' + 'tnc'
|
||||
|
||||
if sys.platform == 'win32' or sys.platform == 'win64':
|
||||
logging_path = os.getenv('APPDATA') + '/' + 'FreeDATA/' + 'tnc'
|
||||
|
||||
if not os.path.exists(logging_path):
|
||||
os.makedirs(logging_path)
|
||||
log_handler.setup_logging(logging_path)
|
||||
except:
|
||||
structlog.get_logger("structlog").error("[DMN] logger init error")
|
||||
|
||||
|
||||
|
||||
structlog.get_logger("structlog").info("[TNC] Starting FreeDATA", author="DJ2LS", year="2022", version="0.1")
|
||||
|
|
Loading…
Reference in a new issue