pypesto.logging
Logging
Logging convenience functions.
Functions
|
Log messages from name with level to any combination of console/file. |
|
Check whether the requested log level is active in any handler. |
|
Log to console. |
|
Log to file. |
- pypesto.logging.log(name: str = 'pypesto', level: int = 20, console: bool = True, filename: str = '')[source]
Log messages from name with level to any combination of console/file.
- Parameters:
name – The name of the logger.
level – The output level to use.
console – If True, messages are logged to console.
filename – If specified, messages are logged to a file with this name.
- pypesto.logging.log_level_active(logger: Logger, level: int) bool [source]
Check whether the requested log level is active in any handler.
This is useful in case log expressions are costly.
- Parameters:
logger – The logger.
level – The requested log level.
- Returns:
Whether there is a handler registered that handles events of importance at least level and higher.
- Return type:
active