mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-10-01 03:15:44 -04:00
Added loglevel override
This commit is contained in:
parent
c5b792f64a
commit
9c1ac46989
@ -78,7 +78,7 @@ class Reticulum:
|
||||
RNS.Transport.exit_handler()
|
||||
RNS.Identity.exit_handler()
|
||||
|
||||
def __init__(self,configdir=None):
|
||||
def __init__(self,configdir=None, loglevel=None):
|
||||
"""
|
||||
Initialises and starts a Reticulum instance. This must be
|
||||
done before any other operations, and Reticulum will not
|
||||
@ -103,6 +103,8 @@ class Reticulum:
|
||||
self.local_interface_port = 37428
|
||||
self.share_instance = True
|
||||
|
||||
self.requested_loglevel = loglevel
|
||||
|
||||
self.is_shared_instance = False
|
||||
self.is_connected_to_shared_instance = False
|
||||
self.is_standalone_instance = False
|
||||
@ -178,7 +180,7 @@ class Reticulum:
|
||||
if "logging" in self.config:
|
||||
for option in self.config["logging"]:
|
||||
value = self.config["logging"][option]
|
||||
if option == "loglevel":
|
||||
if option == "loglevel" and self.requested_loglevel == None:
|
||||
RNS.loglevel = int(value)
|
||||
if RNS.loglevel < 0:
|
||||
RNS.loglevel = 0
|
||||
|
Loading…
Reference in New Issue
Block a user