ema workbench

Table Of Contents

Other Sub Sites

EMAlogging

Created on 23 dec. 2010

Code author: jhkwakkel <j.h.kwakkel (at) tudelft (dot) nl>

This module contains code for logging EMA processes. It is modeled on the default logging approach that comes with Python. This logging system will also work in case of multiprocessing using parallelEMA.

EMAlogging.log_to_stderr(level=None)

Turn on logging and add a handler which prints to stderr

Parameters:level – minimum level of the messages that will be logged
EMAlogging.get_logger()

Returns logger used by the EMA workbench

Returns:the logger of the EMA workbench
EMAlogging.debug(msg, *args)

convenience function for logger.debug

Parameters:
  • msg – msg to log
  • args – args to pass on to the logger
EMAlogging.info(msg, *args)

convenience function for logger.info

Parameters:
  • msg – msg to log
  • args – args to pass on to the logger
EMAlogging.warning(msg, *args)

convenience function for logger.warning

Parameters:
  • msg – msg to log
  • args – args to pass on to the logger
EMAlogging.error(msg, *args)

convenience function for logger.error

Parameters:
  • msg – msg to log
  • args – args to pass on to the logger
EMAlogging.exception(msg, *args)

convenience function for logger.exception

Parameters:
  • msg – msg to log
  • args – args to pass on to the logger
EMAlogging.critical(msg, *args)

convenience function for logger.critical

Parameters:
  • msg – msg to log
  • args – args to pass on to the logger

NullHandler

class EMAlogging.NullHandler(level=0)

convenience handler that does nothing

TlsSMTPHandler

class EMAlogging.TlsSMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None)

class for using gmail as a server for sending e-mails contain logging messages

emit(record)

Emit a record.

Format the record and send it to the specified addressees. code found online