Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 30, 2023
1 parent e67d945 commit 9523e85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ def create_formatter(
)
custom_key_filter = ConsoleMetadataFilter(key_set)
elif logging_format == "console":
format_string = custom_console_format if custom_console_format else StructlogMetadataBuilder(
metadata_keys).build_console_format()
format_string = (
custom_console_format
if custom_console_format
else StructlogMetadataBuilder(metadata_keys).build_console_format()
)
formatter = ConsoleFormatter(fmt=format_string)
custom_key_filter = ConsoleMetadataFilter(key_set)

Expand Down
5 changes: 3 additions & 2 deletions projects/vdk-plugins/vdk-structlog/tests/test_structlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ def test_custom_format_not_applied_for_non_console_formats(log_format):

for log in logs:
if "Log statement with no bound context" in log:
assert not _matches_custom_format(log), \
f"Custom format was incorrectly applied for {log_format} format. Log: {log}"
assert not _matches_custom_format(
log
), f"Custom format was incorrectly applied for {log_format} format. Log: {log}"
break
else:
pytest.fail("Log statement with no bound context not found in logs")
Expand Down

0 comments on commit 9523e85

Please sign in to comment.