Common module: standard_logging.py

script_logging.standard_logging

This module contains a set of commands that initialize logging.Logger objects with standard sets of pre-defined options. The idea here is that I have a standard basic logger with set suite of information logged as a header to the logfile. In addition then, I can also have a ‘cluster logger’ with a set of pre-defined cluster oriented logging options that can be added to the standard logger for scripts that need cluster support, etc etc

module_version:1.0
created_on:2013-04-09

Standard Logging

script_logging.standard_logging.standard_logger(script_version, cmd_line, script_args, pos_args, kw_args, logbase=None)[source]

Set up a logger with a standard set of options and an automatic header.

The standard info logged here required that a root logger has already been instantized and is designed to work with a set of command line options that has been parsed with the argparse package passed to the routine. The raw command line and master script version is also passed to the logger and recorded to that 1) its clear what command line was used and what version of the script was run and 2) its clear whether the command line was parsed correctly.

Table Of Contents

Previous topic

Common Routines: Logging

Next topic

Common Routines: Argument parsing

This Page