Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a logging.Filter implementation #52

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix(tests): Even more coding style
znerol committed Dec 4, 2021
commit fe9f79424daa23ed3fe1d9833a5bbdf0e3e721e7
4 changes: 2 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
@@ -349,7 +349,7 @@ def test_logging_filter_args(caplog):
logging.getLogger("anonip").setLevel(logging.CRITICAL)

logger = logging.getLogger("filter_args")
logger.addFilter(anonip.AnonipFilter(args=['ip', 'non-existing-attr'], extra=[]))
logger.addFilter(anonip.AnonipFilter(args=["ip", "non-existing-attr"], extra=[]))
logger.setLevel(logging.INFO)

logger.info("%(ip)s string", {"ip": "192.168.100.200"})
@@ -374,7 +374,7 @@ def test_logging_filter_extra(caplog):
logger = logging.getLogger("filter_args")
logger.addFilter(
anonip.AnonipFilter(
extra=['ip', 'non-existing-key'], anonip={"ipv4mask": 16, "ipv6mask": 64}
extra=["ip", "non-existing-key"], anonip={"ipv4mask": 16, "ipv6mask": 64}
)
)
logger.setLevel(logging.INFO)