From 817740d442c660f503fecd74cc2f585b7b00fbed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCllenhaupt?= Date: Thu, 25 Apr 2019 10:08:12 +0200 Subject: [PATCH] set log directory for ice-adapter --- src/connectivity/IceAdapterProcess.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/connectivity/IceAdapterProcess.py b/src/connectivity/IceAdapterProcess.py index 9468a6a03..9132f41a1 100644 --- a/src/connectivity/IceAdapterProcess.py +++ b/src/connectivity/IceAdapterProcess.py @@ -1,5 +1,5 @@ from decorators import with_logger -from PyQt5.QtCore import QProcess +from PyQt5.QtCore import QProcess, QProcessEnvironment from PyQt5.QtNetwork import QTcpServer, QHostAddress from PyQt5.QtWidgets import QMessageBox import os @@ -33,12 +33,17 @@ def __init__(self, player_id, player_login): "--gpgnet-port", "0", "--info-window", "--delay-ui", "10000", - "--log-level" , "debug", - "--log-directory", Settings.get('client/logs/path', type=str)] + "--log-level" , "debug"] if Settings.contains('iceadapter/args'): args += Settings.get('iceadapter/args', "", type=str).split(" ") self._logger.debug("running ice adapter with {} {}".format(exe_path, " ".join(args))) + + # set log directory via ENV + env = QProcessEnvironment.systemEnvironment() + env.insert("LOG_DIR", Settings.get('client/logs/path', type=str)) + self.ice_adapter_process.setProcessEnvironment(env) + self.ice_adapter_process.start(exe_path, args) # wait for the first message which usually means the ICE adapter is listening for JSONRPC connections