Package turbomail :: Package extensions :: Module maillog :: Class TurboMailHandler
[hide private]
[frames] | no frames]

Class TurboMailHandler

source code

logging.Filterer --+    
                   |    
     logging.Handler --+
                       |
                      TurboMailHandler

A class which sends records out via e-mail.

The built-in SMTPHandler is insufficient for most jobs, restricting developers to unauthenticated communication over the standard port, with little control over additional delivery options.

This handler should be configured using the same configuration directives that TurboMail itself understands. If you do not specify `mail.on` in the configuration, this handler will attempt to use a previously configured TurboMail environment.

Be sure that TurboMail is running before messages are emitted using this handler, and be careful how many notifications get sent.

It is suggested to use background delivery using the 'demand' manager.

Configuration options for this handler are as follows:

   * mail.handler.priorities = [True/False]
     Set message priority using the following formula:
       record.levelno / 10 - 3
   
   * 
Instance Methods [hide private]
 
__init__(self, *args, **config)
Initialize the instance, optionally configuring TurboMail itself.
source code
 
emit(self, record)
Emit a record.
source code

Inherited from logging.Handler: acquire, close, createLock, flush, format, handle, handleError, release, setFormatter, setLevel

Inherited from logging.Filterer: addFilter, filter, removeFilter

Method Details [hide private]

__init__(self, *args, **config)
(Constructor)

source code 

Initialize the instance, optionally configuring TurboMail itself.

If no additional arguments are supplied to the handler, re-use any existing running TurboMail configuration.

To get around limitations of the INI parser, you can pass in a tuple of name, value pairs to populate the dictionary. (Use `{}` dict notation in produciton, though.)

Overrides: logging.Filterer.__init__

emit(self, record)

source code 

Emit a record.

Overrides: logging.Handler.emit