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

critical(*args: Any, **kwargs: Any) None[source]#
debug(*args: Any, **kwargs: Any) None[source]#
error(*args: Any, **kwargs: Any) None[source]#
info(*args: Any, **kwargs: Any) None[source]#
remove() None[source]#

This function removes all sinks from the logger.

trace(*args: Any, **kwargs: Any) None[source]#
traceback(*args: Any, **kwargs: Any) None[source]#
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

warning(*args: Any, **kwargs: Any) None[source]#