datagnosis.logger module#
- add(sink: Union[None, str, os.PathLike, TextIO, logging.Handler] = None, level: str = 'ERROR') None[source]#
This function adds a sink to the logger.
- Parameters
sink (Union[None, str, os.PathLike, TextIO, logging.Handler], optional) – The sink to add. Defaults to None.
level (str, optional) – The level to log at. Defaults to “ERROR”.
- create_log_and_print_function(level: str) Callable[source]#
This function creates a log and print function.
- Parameters
level (str) – The level to log at.
- Returns
The log and print function.
- Return type
Callable
- traceback_and_raise(e: Any, verbose: bool = False) NoReturn[source]#
This function prints the traceback and raises the exception.
- Parameters
e (Any) – The exception to raise.
verbose (bool, optional) – A Flag to indicate whether to print the traceback. Defaults to False.
- Raises
e – The exception to raise.
- Returns
This function does not return.
- Return type
NoReturn