Skip to content

Commit

Permalink
fix(style): Coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
znerol committed Nov 29, 2021
1 parent 75c0b43 commit 1637821
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anonip.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ def __init__(self, args=None, extra=None, anonip=None):
An implementation of Python logging.Filter using anonip.
:param args: list of log message args to filter. Defaults to []
:param extra: list of LogRecord attributes to filter. Defaults to ['msg']
:param extra: list of LogRecord attributes to filter. Defaults to ["msg"]
:param anonip: dict of parameters for Anonip instance
"""
self.args = args or []
self.extra = extra or ['msg']
self.extra = extra or ["msg"]
self.anonip = Anonip(**(anonip or {}))

def filter(self, record):
Expand Down
3 changes: 3 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def test_properties_columns():
a.columns = [5, 6]
assert a.columns == [4, 5]


def test_logging_filter_defaults(caplog):
logging.disable(logging.NOTSET)
logging.getLogger("anonip").setLevel(logging.CRITICAL)
Expand All @@ -342,6 +343,7 @@ def test_logging_filter_defaults(caplog):

logging.disable(logging.CRITICAL)


def test_logging_filter_args(caplog):
logging.disable(logging.NOTSET)
logging.getLogger("anonip").setLevel(logging.CRITICAL)
Expand All @@ -364,6 +366,7 @@ def test_logging_filter_args(caplog):

logging.disable(logging.CRITICAL)


def test_logging_filter_extra(caplog):
logging.disable(logging.NOTSET)
logging.getLogger("anonip").setLevel(logging.CRITICAL)
Expand Down

0 comments on commit 1637821

Please sign in to comment.