From 6e405556127a3ef83c2948208bf6cb93d65588d1 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Wed, 2 May 2018 20:58:02 +0200 Subject: [PATCH] Only log online_clients if there are any at the end of a logfile. --- tsstats/log.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tsstats/log.py b/tsstats/log.py index db8e62b..7dabf33 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -148,9 +148,10 @@ def parse_logs(log_glob, ident_map=None, online_dc=True): filter(lambda c: c.connected, clients.values()) ) - logger.debug( - 'Some clients are still connected: %s', online_clients - ) + if online_clients: + logger.debug( + 'Some clients are still connected: %s', online_clients + ) if index == len(logs) - 1 and online_dc: logger.debug('Last log => disconnecting online clients') # last iteration => disconnect online clients if desired