Get rid of confusing debug logging

When count is its default of -1, we get confusing debug logging counting
down negative numbers as the function listens for a matching event. This
gets rid of that by only logging when the count is positive.

Inspired by d74c155.
This commit is contained in:
Erik Johnson 2018-04-02 09:09:24 -05:00
parent 395b7f8fdc
commit 5d6de3a2eb
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -2030,8 +2030,9 @@ def event(tagmatch='*',
indent=None if not pretty else 4)))
sys.stdout.flush()
count -= 1
log.debug('Remaining event matches: %s', count)
if count > 0:
count -= 1
log.debug('Remaining event matches: %s', count)
if count == 0:
break