From 882e2794365a7c3f3439fc9dccf09bf750380705 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 8 Sep 2017 14:33:19 +0200 Subject: [PATCH] Use NullHandler instead of basicConfig logging.basicConfig() was propably added to avoid the dreaded "no log handler found for ..." messages however this is the wrong approach because it interferes with the log handling in applications using the library, instead libraries should never set up log handlers and leave it to client application. To avoid the message, libraries can register the NullHandler though, see for example: http://docs.python-guide.org/en/latest/writing/logging/#logging-in-a-library --- dxchange/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxchange/__init__.py b/dxchange/__init__.py index ecd257b..21dabae 100644 --- a/dxchange/__init__.py +++ b/dxchange/__init__.py @@ -50,7 +50,7 @@ unicode_literals) import logging -logging.basicConfig() +logging.getLogger(__name__).addHandler(logging.NullHandler()) from dxchange.exchange import * from dxchange.reader import *