Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 2d203a8

Browse files
committed
Don't create handler on every call to DEBUG
1 parent 8b84120 commit 2d203a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ethereum/slogging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ def get_logger(name=None):
270270
def DEBUG(msg, *args, **kwargs):
271271
"""temporary logger during development that is always on"""
272272
logger = getLogger("DEBUG")
273-
logger.addHandler(StreamHandler())
273+
if len(logger.handlers) == 0:
274+
logger.addHandler(StreamHandler())
274275
logger.propagate = False
275276
logger.setLevel(logging.DEBUG)
276277
logger.DEV(msg, *args, **kwargs)

0 commit comments

Comments
 (0)