Skip to content

Commit 4c99d5f

Browse files
lucianopazColCarroll
authored andcommitted
Prevents repeated logs by not adding log handlers if they were already present (#3362)
1 parent 9f07500 commit 4c99d5f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymc3/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
_log = logging.getLogger('pymc3')
3232
if not logging.root.handlers:
3333
_log.setLevel(logging.INFO)
34-
handler = logging.StreamHandler()
35-
_log.addHandler(handler)
34+
if len(_log.handlers) == 0:
35+
handler = logging.StreamHandler()
36+
_log.addHandler(handler)

0 commit comments

Comments
 (0)