utils.logging¶
Functions for convenient logging.
setup_rich_logging ¶
setup_rich_logging(console=None, **kwargs)
Set up a logger that uses rich markup and severity tracking.
This function is intended to be called in a script. It calls logging.basicConfig and is therefore not executed by default, as applications may wish to setup their loggers differently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
console
|
Optional[Console]
|
A rich.Console object to output log messages to. |
None
|
**kwargs
|
object
|
Any keyword argument will be forwarded to logging.basicConfig. If logging handlers are defined here, they will be preserved in addition to the handlers added by this function. If 'level' is not given, it will default to 'INFO'. |
{}
|
Returns:
| Type | Description |
|---|---|
SeverityTracker
|
The severity tracker, so that it can be used to check the highest emitted log level. |