sp_logger#

scikitplot.sp_logging.sp_logger = <scikitplot.sp_logging.SpLogger object>[source]#

An instance of SpLogger, providing logging functionality.

See also

get_logger

Function that provides a shared logging.Logger instance.

SpLogger

A singleton logger class that provides a shared logging.Logger instance with customizable name, formatter, handler, logging level, and thread-safety.

logging.getLogger

Standard library function to retrieve logging.Logger instance, for more https://docs.python.org/3/library/logging.html.

Examples

Get a root logger by module:

>>> import scikitplot.sp_logging as logging  # module logger
>>> logging.setLevel(logging.INFO)           # default WARNING
>>> logging.info("This is a info message from the sp logger.")
2025-01-17 22:20:28 INFO scikitplot 140339417843520 sp_logging.py 820 This is a info message from the sp logger. 

Get a root logger by func:

>>> from scikitplot import sp_logging, get_logger; logging=get_logger()  # pure python logger, not have direct log level
>>> logging.setLevel(sp_logging.INFO)                                    # default WARNING
>>> logging.info("This is a info message from the sp logger.")
2025-01-17 22:20:28 INFO scikitplot 140339417843520 1353514787.py 3 This is a info message from the sp logger. 

Get a root logger by class:

>>> from scikitplot import SpLogger; logging=SpLogger()  # class logger
>>> logging.setLevel(logging.INFO)                       # default WARNING
>>> logging.info("This is a info message from the sp logger.")
2025-01-17 22:20:28 INFO scikitplot 140339417843520 sp_logging.py 1146 This is a info message from the sp logger. 

Get a root logger by class instance:

>>> from scikitplot import sp_logger as logging  # class instance logger
>>> logging.setLevel(logging.INFO)               # default WARNING
>>> logging.info("This is a info message from the sp logger.")
2025-01-17 22:20:28 INFO scikitplot 140339417843520 sp_logging.py 1146 This is a info message from the sp logger.