Skip to content

Commit

Permalink
docs: replace level=logging.ERROR with event_level=... in README.md
Browse files Browse the repository at this point in the history
As `event_level` actually filters events, while `level` only impacts breadcrumbs.
The doc is quite clear about the functionality, but we actually tripped on this,
probably because we just copy/pasted one of the examples.
"Fixing" the examples might save others from tripping as we did :)
  • Loading branch information
serl authored and paveldedik committed Apr 17, 2024
1 parent e5712ab commit 0a6d19a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ structlog.configure(
processors=[
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
SentryProcessor(level=logging.ERROR, tag_keys=["city", "timezone"]),
SentryProcessor(event_level=logging.ERROR, tag_keys=["city", "timezone"]),
],...
)

Expand All @@ -128,7 +128,7 @@ structlog.configure(
processors=[
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
SentryProcessor(level=logging.ERROR, tag_keys="__all__"),
SentryProcessor(event_level=logging.ERROR, tag_keys="__all__"),
],...
)
```
Expand All @@ -143,7 +143,7 @@ structlog.configure(
processors=[
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
SentryProcessor(level=logging.ERROR, as_context=False, tag_keys="__all__"),
SentryProcessor(event_level=logging.ERROR, as_context=False, tag_keys="__all__"),
],...
)
```
Expand All @@ -158,7 +158,7 @@ structlog.configure(
processors=[
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
SentryProcessor(level=logging.ERROR, ignore_loggers=["some.logger"]),
SentryProcessor(event_level=logging.ERROR, ignore_loggers=["some.logger"]),
],...
)
```
Expand Down

0 comments on commit 0a6d19a

Please sign in to comment.