molclusters.log¶
log
¶
Logging tools and configuration.
format_duration
¶
Format a duration for humans, e.g. 4.2s, 12m 03s or 1h 02m 03s.
Returns:
| Type | Description |
|---|---|
str
|
The formatted duration. |
Source code in src/molclusters/log.py
start_logging
¶
start_logging(level: Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] | int = 'INFO', *, filename: Path | str = Path('molclusters.log')) -> None
Start log handlers for the molclusters library.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL'] | int
|
Log level to start the logger, by default "INFO" |
'INFO'
|
filename
|
Path | str
|
The log file, by default "molclusters.log"; a serialized copy is written
next to it with a |
Path('molclusters.log')
|