log¶
Logging of the package.
pymetadata follows the convention for libraries: it only gets loggers and logs
to them, it does not configure logging. Handlers, levels and formatting are left
to the application, which keeps the messages of the package under the control of
whoever uses it.
Modules get their logger from the standard library with
All loggers are therefore below the pymetadata logger, so an application
configures them in one place:
For scripts and interactive work the rich formatting of the package can be enabled explicitly, which is what the examples do:
enable_rich_logging
¶
Log the messages of the package on a rich console.
This configures logging and is meant for scripts, examples and interactive work. Applications should configure logging themselves instead of calling this. Calling it repeatedly replaces the handler instead of adding a second one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
level from which messages are logged |
INFO
|
console
|
Console | None
|
console to log on, the console of the package by default |
None
|
Returns:
| Type | Description |
|---|---|
Logger
|
The |