Skip to content

Commit

Permalink
[remote logging] add option to enable / disable it.
Browse files Browse the repository at this point in the history
  • Loading branch information
belyalov committed Jul 16, 2018
1 parent a1bec00 commit 867d8f0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions platform/utils/remotelogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,14 @@ def __init__(self, hostname, config):
name - system name (e.g. esp-010101)
config - SimpleConfig (from utils/config.py)
"""
config.add_param('remote_logging_ip', '',
callback=self.callback,
group='rlogging')
config.add_param('remote_logging_port', 0,
callback=self.callback,
group='rlogging')
config.add_param('remote_logging_on', False, callback=self.callback)
config.add_param('remote_logging_ip', 'localhost')
config.add_param('remote_logging_port', 514)
self.cfg = config
self.hostname = hostname

def callback(self):
if self.cfg.remote_logging_port > 0 \
and self.cfg.remote_logging_ip != '':
if self.cfg.remote_logging_on:
# Enable remote logging
self.stream = RemoteStream(self.hostname,
self.cfg.remote_logging_ip,
Expand Down

0 comments on commit 867d8f0

Please sign in to comment.