Slicer/Slicer — pull request #207 by lassoan (2014-12-10 17:35:29+00:00)
Title: ENH: Use Python logging framework for scripted module logging

Use Python's built-in logging module to manage logging. A direct advantage is that line number, file name, method name can be logged, too. Also, it follows the convention of using qt-style logging in qt classes, vtk-style logging in vtk classes, etc.

Default behavior of log levels:
DEBUG: log to application log only, includes file name, line number, thread
INFO: log to stdout (appears in application log, too)
WARNING: log to stderr (appears in application log, too)
ERROR: log to stderr (appears in application log, too)

Usage:
logging.debug("this is a debug message")
logging.info("this is an info message")
logging.warning("this is a warning message")
logging.error("this is a error message")

TODO: once context.setFile() wrapping is implemented in __init__.py this line should be uncommented to enable logging of path name:
context.setFile(record.pathname)