liblog: Logging helping functions
Manage logging and logging helper functions.
- haddock.libs.liblog.add_handler(log_obj: Logger, handler: type[StreamHandlerT], stream: str | Path | TextIO, log_level: str = 'INFO', formatter: str = '[%(asctime)s %(module)s %(levelname)s] %(message)s') StreamHandlerT [source]
Add a logging Handler to the log object.
- haddock.libs.liblog.add_log_for_CLI(log: Logger, log_level: str, logfile: str | Path) None [source]
Configure log for command-line clients.
- haddock.libs.liblog.add_logfile_handler(log_obj: ~logging.Logger, *, handler: type[~haddock.core.typing.StreamHandlerT] = <class 'logging.FileHandler'>, stream: str | ~pathlib.Path | ~typing.TextIO = 'log', log_level: str = 'INFO', formatter: str = '[%(asctime)s %(module)s %(levelname)s] %(message)s') StreamHandlerT
Add a logging Handler to the log object.
- haddock.libs.liblog.add_loglevel_arg(parser: ArgumentParser) None [source]
Add log level argument to CLI.
- haddock.libs.liblog.add_stringio_handler(log_obj: ~logging.Logger, *, handler: type[~haddock.core.typing.StreamHandlerT] = <class 'logging.StreamHandler'>, stream: str | ~pathlib.Path | ~typing.TextIO = <_io.StringIO object>, log_level: str = 'INFO', formatter: str = '[%(asctime)s %(module)s %(levelname)s] %(message)s') StreamHandlerT
Add a logging Handler to the log object.
- haddock.libs.liblog.add_syserr_handler(log_obj: ~logging.Logger, *, handler: type[~haddock.core.typing.StreamHandlerT] = <class 'logging.StreamHandler'>, stream: str | ~pathlib.Path | ~typing.TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, log_level: str = 'ERROR', formatter: str = '[%(asctime)s %(module)s %(levelname)s] %(message)s') StreamHandlerT
Add a logging Handler to the log object.
- haddock.libs.liblog.add_sysout_handler(log_obj: ~logging.Logger, *, handler: type[~haddock.core.typing.StreamHandlerT] = <class 'logging.StreamHandler'>, stream: str | ~pathlib.Path | ~typing.TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, log_level: str = 'INFO', formatter: str = '[%(asctime)s %(module)s %(levelname)s] %(message)s') StreamHandlerT
Add a logging Handler to the log object.