Skip to content

Commit

Permalink
Stop writing records for disabled levels
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Mar 30, 2018
1 parent 6a4c60c commit 63c7e9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision History

## 0.3.1 (2018/03/30)

- Fixed bug where records were written for disabled levels.

## 0.3 (2018/03/15)

- Exposed `logging` level constants on the `log` package.
Expand Down
2 changes: 1 addition & 1 deletion log/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
e = error

__project__ = 'minilog'
__version__ = '0.3'
__version__ = '0.3.1'
3 changes: 3 additions & 0 deletions log/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def create_logger_record(level, message, *args, **kwargs):
module = inspect.getmodule(frame)

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

record = logger.makeRecord(
module.__name__,
level,
Expand Down

0 comments on commit 63c7e9c

Please sign in to comment.