psyplot.config.logsetup module

Logging configuration module of the psyplot package

This module defines the essential functions for setting up the logging.Logger instances that are used by the psyplot package.

Functions:

setup_logging([default_path, default_level, ...])

Setup logging configuration

psyplot.config.logsetup.setup_logging(default_path=None, default_level=20, env_key='LOG_PSYPLOT')[source]

Setup logging configuration

Parameters
  • default_path (str) – Default path of the yaml logging configuration file. If None, it defaults to the ‘logging.yaml’ file in the config directory

  • default_level (int) – Default: logging.INFO. Default level if default_path does not exist

  • env_key (str) – environment variable specifying a different logging file than default_path (Default: ‘LOG_CFG’)

Returns

path – Path to the logging configuration file

Return type

str

Notes

Function taken from http://victorlin.me/posts/2012/08/26/good-logging-practice-in-python