Skip to content

Commit

Permalink
doc: extend a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Sep 16, 2024
1 parent e634812 commit bca2b66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/good_to_know.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ You can configure loguru in your code:
import sys
from loguru import logger

# Configure a logger with custom settings (requires first removing the default logger)
logger.remove()
logger.add(sys.stderr, filter="bfabric", level="WARNING", colorize=False)

# Alternative: completely deactivate logs for bfabricPy
logger.disable("bfabric")
```

Check the documentation for [logger.add](https://loguru.readthedocs.io/en/stable/api/logger.html#loguru._logger.Logger.add) for more options.
By default, the logs go to standard error, which can be useful in some scenarios.

Alternatively, you can set the environment variable `LOGURU_LEVEL`, e.g. `LOGURU_LEVEL=WARNING`. However, this will affect all loguru loggers in your code and may thus not be the preferable approach.

Expand Down

0 comments on commit bca2b66

Please sign in to comment.