diff --git a/src/caosdb/connection/authentication/interface.py b/src/caosdb/connection/authentication/interface.py index a364aeb564ee929d995b2f8098bd21e30e9733ab..f2cc5001cf8fa0f6d61ec65346f6a200ba0dfcd8 100644 --- a/src/caosdb/connection/authentication/interface.py +++ b/src/caosdb/connection/authentication/interface.py @@ -36,7 +36,7 @@ from caosdb.exceptions import LoginFailedError # meta class compatible with Python 2 *and* 3: ABC = ABCMeta('ABC', (object, ), {'__slots__': ()}) -_LOGGER = logging.getLogger("authentication") +_LOGGER = logging.getLogger(__name__) class AbstractAuthenticator(ABC): diff --git a/src/caosdb/connection/connection.py b/src/caosdb/connection/connection.py index 9e273a56778737033fda9f342f967f56946b501b..6c3946ee639872b0edb0b5b3c30a808cf8c028d4 100644 --- a/src/caosdb/connection/connection.py +++ b/src/caosdb/connection/connection.py @@ -60,7 +60,7 @@ except ImportError: # pylint: disable=missing-docstring -_LOGGER = logging.getLogger("connection") +_LOGGER = logging.getLogger(__name__) class _WrappedHTTPResponse(CaosDBHTTPResponse): diff --git a/unittests/test_authentication_plain.py b/unittests/test_authentication_plain.py index 10cbc418df8bd81c81568a4df0cf1e8a4ac498f8..146b59889c71c86ea77fb4ae962118cdda1afb06 100644 --- a/unittests/test_authentication_plain.py +++ b/unittests/test_authentication_plain.py @@ -65,4 +65,6 @@ def test_subclass_configure(): def test_plain_has_logger(): p = PlainTextCredentialsProvider() assert hasattr(p, "logger") - assert p.logger.name == "authentication" + assert "authentication" in p.logger.name + assert "connection" in p.logger.name + assert "caosdb" in p.logger.name