3. Source doc

3.1. Module quicklogging

(logging with a bit of cozyness)

3.1.1. log wrappers

Supplied convenience functions fetch a logger with the name of the module from which you’re calling them.
quicklogging.debug(*args, **kwargs)[source]

wrapper for logging.Logger.debug()

Variadic parameters: see logging.Logger.debug()

Parameters:stackoverhead (int) – see quicklogging.base.get_logger()
quicklogging.info(*args, **kwargs)[source]

wrapper for logging.Logger.info()

Variadic parameters: see logging.Logger.info()

Parameters:stackoverhead (int) – see quicklogging.base.get_logger()
quicklogging.warning(*args, **kwargs)[source]

wrapper for logging.Logger.warning()

Variadic parameters: see logging.Logger.warning()

Parameters:stackoverhead (int) – see quicklogging.base.get_logger()
quicklogging.error(*args, **kwargs)[source]

wrapper for logging.Logger.error()

Variadic parameters: see logging.Logger.error()

Parameters:stackoverhead (int) – see quicklogging.base.get_logger()
quicklogging.critical(*args, **kwargs)[source]

wrapper for logging.Logger.critical()

Variadic parameters: see logging.Logger.critical()

Parameters:stackoverhead (int) – see quicklogging.base.get_logger()
quicklogging.exception(*args, **kwargs)[source]

wrapper for logging.Logger.exception()

Variadic parameters: see logging.Logger.exception()

Parameters:stackoverhead (int) – see quicklogging.base.get_logger()

3.2. Module quicklogging.base


wrapper for getLogger

Typical use, say you’re in project/module/submodule.py and you want a logger.

l = get_logger()
<logging.Logger at ... >
Parameters:stackoverhead (int) – defaults to 0. How deep to look in the stack for fetching the logger name.
Returns:a logger named after the module at depth stackoverhead.
Return type:logging.Logger
quicklogging.base._log_with_level(func_name, *args, **kwargs)[source]

Internal convenience function to log with appropriate level

This function is called by the main log wrappers.

Fetches the appropriate logger, then the function named after the param func_name. This is slow, you’d better use :py:func`get_logger`.

  • func_name (str) – One of ‘debug’, ‘info’, ‘error’, etc
  • stackoverhead (int) – defaults to 0. How deep to look in the stack for
Return type:


3.3. Module quicklogging.stream_wrapper

class quicklogging.stream_wrapper.StreamWrapper(original_stream, logfunc, catch_all=False, warn=False)[source]

Implementation detail