Package logging :: Module handlers :: Class SMTPHandler
[hide private]
[frames] | no frames]

_ClassType SMTPHandler

Filterer --+    
           |    
     Handler --+
               |
              SMTPHandler

A handler class which sends an SMTP email for each logging event.

Instance Methods [hide private]
 
__init__(self, mailhost, fromaddr, toaddrs, subject)
Initialize the handler.
 
getSubject(self, record)
Determine the subject for the email.
 
date_time(self)
Return the current date and time formatted for a MIME header.
 
emit(self, record)
Emit a record.

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

Inherited from Filterer: addFilter, filter, removeFilter

Class Variables [hide private]
  weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', '...
Method Details [hide private]

__init__(self, mailhost, fromaddr, toaddrs, subject)
(Constructor)

 

Initialize the handler.

Initialize the instance with the from and to addresses and subject line of the email. To specify a non-standard SMTP port, use the (host, port) tuple format for the mailhost argument.

Overrides: Filterer.__init__

getSubject(self, record)

 

Determine the subject for the email.

If you want to specify a subject line which is record-dependent, override this method.

date_time(self)

 

Return the current date and time formatted for a MIME header. Needed for Python 1.5.2 (no email package available)

emit(self, record)

 

Emit a record.

Format the record and send it to the specified addressees.

Overrides: Handler.emit

Class Variable Details [hide private]

monthname

Value:
[None,
 'Jan',
 'Feb',
 'Mar',
 'Apr',
 'May',
 'Jun',
 'Jul',
...