Skip to content

Commit

Permalink
Configure logging handlers before submodule imports
Browse files Browse the repository at this point in the history
- Fix #474
- Fix #475
  • Loading branch information
mpenkov committed Apr 16, 2020
1 parent c0a9b79 commit d9ce6cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions smart_open/__init__.py
Expand Up @@ -25,6 +25,10 @@
import logging
from smart_open import version

logger = logging.getLogger(__name__)
if len(logger.handlers) == 0:
logger.addHandler(logging.NullHandler())

from .smart_open_lib import open, parse_uri, smart_open, register_compressor
from .s3 import iter_bucket as s3_iter_bucket

Expand All @@ -36,8 +40,4 @@
'smart_open',
]


__version__ = version.__version__

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

0 comments on commit d9ce6cc

Please sign in to comment.