Skip to content

Commit 7828844

Browse files
authored
Only log if there is a handler
1 parent af08521 commit 7828844

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def log(self, level: int, msg: str, *args):
233233
:param args: arguments to ``format_string.format()``; can be empty
234234
235235
"""
236-
if level >= self._level:
236+
if _handler and level >= self._level:
237237
self._handler._emit(level, msg % args) # pylint: disable=protected-access
238238

239239
def debug(self, msg: str, *args):

0 commit comments

Comments
 (0)