array_split.logging.initialise_loggers¶
-
array_split.logging.
initialise_loggers
(names, log_level=30, handler_class=<class 'array_split.logging.SplitStreamHandler'>)[source]¶ Initialises specified loggers to generate output at the specified logging level. If the specified named loggers do not exist, they are created.
Parameters: - names (
list
ofstr
) – List of logger names. - log_level (
int
) – Log level for messages, typically one oflogging.DEBUG
,logging.INFO
,logging.WARN
,logging.ERROR
orlogging.CRITICAL
. See Logging Levels. - handler_class (One of the
logging.handlers
classes.) – The handler class for output of log messages, for exampleSplitStreamHandler
orlogging.StreamHandler
.
Example:
>>> from array_split import logging >>> logging.initialise_loggers(["my_logger",], log_level=logging.INFO) >>> logger = logging.getLogger("my_logger") >>> logger.info("This is info logging.") 16:35:09|ARRSPLT| This is info logging. >>> logger.debug("Not logged at logging.INFO level.") >>>
- names (