Skip to content

Commit

Permalink
Merge branch 'main' into alex/httpx-response-json
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Dec 20, 2024
2 parents d32c1a4 + cac58a9 commit c873e48
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/integrations/logging.md
Original file line number Diff line number Diff line change
@@ -21,4 +21,23 @@ logger.error("Hello %s!", "Fred")
# 10:05:06.855 Hello Fred!
```

## Oh no! Too many logs from...

A common issue with logging is that it can be **too verbose**... Right? :sweat_smile:

Don't worry! We are here to help you.

In those cases, you can set the log level to a higher value to suppress logs that are less important.
Let's see an example with the [`apscheduler`](https://apscheduler.readthedocs.io/en/3.x/) logger:

```py title="main.py"
import logging

logger = logging.getLogger("apscheduler")
logger.setLevel(logging.WARNING)
```

In this example, we set the log level of the `apscheduler` logger to `WARNING`, which means that
only logs with a level of `WARNING` or higher will be emitted.

[logging]: https://docs.python.org/3/library/logging.html

0 comments on commit c873e48

Please sign in to comment.