Package firetools :: Module RunConfig
[hide private]
[frames] | no frames]

Module RunConfig

source code

Run a Script including logging and error trapping

At the command prompt run this script with the target script as the first argument. As in this example (but use absolute paths)

>> python.exe RunConfig.py Configfile.py

Initially, this module sets up a console stream log. Then a call to Run() will execute a script including:

  1. set up a log file based on the input script (path_LOG.txt)
  2. execute the script [path] within a try-except block
  3. print and write log for any exception before quitting
Functions [hide private]
 
AddLogFile(logfile)
Add a logging file handler
source code
 
FormatTrace()
trace the current error and format the message
source code
 
Run(script)
Run a script with logging and debugging
source code
Variables [hide private]
  log = logging.getLogger()
  formatter = logging.Formatter("%(asctime)s:%(name)s:%(message)...
  ch = logging.StreamHandler()
Variables Details [hide private]

formatter

Value:
logging.Formatter("%(asctime)s:%(name)s:%(message)s", datefmt= "%H:%M:\
%S")