configure_logging#

scikitplot.cleanprompt.configure_logging(level='warning', fmt='text', stream=None)[source]#

Attach a handler to this submodule’s logger.

Parameters:
levelstr, default=’warning’

One of critical, error, warning, info, debug.

fmtstr, default=’text’

"text" or "json".

streamfile-like, optional

Destination. Defaults to sys.stderr, because standard output carries results and a log line in a pipe would corrupt them.

Returns:
logging.Logger

This submodule’s logger.

Raises:
ValueError

If level or fmt is unknown.

Parameters:
Return type:

Logger

Notes

Developer notes. Replaces any handler this function previously attached, and leaves handlers the application attached alone. Calling it twice therefore does not double every line — the duplicate-handler defect that makes library logging notorious.

propagate is left True so an application that configured root logging still receives these records; the handler attached here is additional, not exclusive. That does mean an application which has configured root logging and calls this will see records twice, which is why this function exists only as an explicit opt-in.