mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-17 13:20:25 -04:00
Added log to console option for daemon mode
This commit is contained in:
parent
a6eac0d7ce
commit
7814712118
3 changed files with 24 additions and 7 deletions
|
@ -46,7 +46,7 @@ class NomadNetworkApp:
|
|||
if issubclass(e_type, KeyboardInterrupt):
|
||||
sys.__excepthook__(e_type, e_value, e_traceback)
|
||||
|
||||
def __init__(self, configdir = None, rnsconfigdir = None, daemon = False):
|
||||
def __init__(self, configdir = None, rnsconfigdir = None, daemon = False, force_console = False):
|
||||
self.version = __version__
|
||||
self.enable_client = False
|
||||
self.enable_node = False
|
||||
|
@ -59,6 +59,11 @@ class NomadNetworkApp:
|
|||
else:
|
||||
self.configdir = configdir
|
||||
|
||||
if force_console:
|
||||
self.force_console_log = True
|
||||
else:
|
||||
self.force_console_log = False
|
||||
|
||||
if NomadNetworkApp._shared_instance == None:
|
||||
NomadNetworkApp._shared_instance = self
|
||||
|
||||
|
@ -490,7 +495,7 @@ class NomadNetworkApp:
|
|||
if RNS.loglevel > 7:
|
||||
RNS.loglevel = 7
|
||||
if option == "destination":
|
||||
if value.lower() == "file":
|
||||
if value.lower() == "file" and not self.force_console_log:
|
||||
RNS.logdest = RNS.LOG_FILE
|
||||
if "logfile" in self.config["logging"]:
|
||||
self.logfilepath = self.config["logging"]["logfile"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue