Skip to content

Commit

Permalink
Explicitly set logger name
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Dec 9, 2018
1 parent 70271d4 commit 58f7528
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision History

## 1.2 (unreleased)

- Fixed bug where logger name is unset when logging during imports.

## 1.1 (2018-10-26)

- Added `%(relpath)s` logging format.
Expand Down
2 changes: 1 addition & 1 deletion log/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create_logger_record(level, message, *args, exc_info=None, **kwargs):
frame, filename, lineno, *_ = inspect.stack()[3]
module = inspect.getmodule(frame)

logger = logging.getLogger()
logger = logging.getLogger(module.__name__)
if not logger.isEnabledFor(level):
return

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]

name = "minilog"
version = "1.2a2"
version = "1.2a3"
description = "Minimalistic wrapper for Python logging."

license = "MIT"
Expand Down

0 comments on commit 58f7528

Please sign in to comment.