;ò
	�ü?c           @   sg  d  Z  d k Z d k Z d k Z d k Z d k Z d k Z d k Z d k Z d k	 Z	 d k
 l Z l Z d Z d Z d Z d Z d Z d e i f d	 „  ƒ  YZ d
 e i f d „  ƒ  YZ d e f d „  ƒ  YZ d e i f d „  ƒ  YZ d e i f d „  ƒ  YZ d e i f d „  ƒ  YZ d e i f d „  ƒ  YZ d e i f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   sb  
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python, and influenced by Apache's log4j system.

Should work under Python versions >= 1.5.2, except that source line
information is not available unless 'inspect' is.

Copyright (C) 2001-2002 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
N(   s   ThreadingTCPServers   StreamRequestHandleri<#  i=#  i>#  i?#  i  s   RotatingFileHandlerc           B   s,   t  Z d d d d „ Z d „  Z d „  Z RS(   Ns   ai    c         C   sF   t  i i |  | | ƒ | |  _ | |  _ | d j o d |  _ n d S(   sú  
        Open the specified file and use it as the stream for logging.

        By default, the file grows indefinitely. You can specify particular
        values of maxBytes and backupCount to allow the file to rollover at
        a predetermined size.

        Rollover occurs whenever the current log file is nearly maxBytes in
        length. If backupCount is >= 1, the system will successively create
        new files with the same pathname as the base file, but with extensions
        ".1", ".2" etc. appended to it. For example, with a backupCount of 5
        and a base file name of "app.log", you would get "app.log",
        "app.log.1", "app.log.2", ... through to "app.log.5". The file being
        written to is always "app.log" - when it gets filled up, it is closed
        and renamed to "app.log.1", and if files "app.log.1", "app.log.2" etc.
        exist, then they are renamed to "app.log.2", "app.log.3" etc.
        respectively.

        If maxBytes is zero, rollover never occurs.
        i    s   aN(   s   loggings   FileHandlers   __init__s   selfs   filenames   modes   maxBytess   backupCount(   s   selfs   filenames   modes   maxBytess   backupCount(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__-   s     		c         C   s  |  i i ƒ  |  i d j oá x– t |  i d d d ƒ D]{ } d |  i | f } d |  i | d f } t	 i
 i | ƒ o8 t	 i
 i | ƒ o t	 i | ƒ n t	 i | | ƒ q7 q7 W|  i d } t	 i
 i | ƒ o t	 i | ƒ n t	 i |  i | ƒ n t |  i d ƒ |  _ d S(   s<   
        Do a rollover, as described in __init__().
        i    i   iÿÿÿÿs   %s.%ds   .1s   wN(   s   selfs   streams   closes   backupCounts   ranges   is   baseFilenames   sfns   dfns   oss   paths   existss   removes   renames   open(   s   selfs   is   sfns   dfn(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys
   doRolloverH   s       c         C   s‚   |  i d j o[ d |  i | ƒ } |  i i d d ƒ |  i i ƒ  t | ƒ |  i j o |  i	 ƒ  qk n t
 i i |  | ƒ d S(   s„   
        Emit a record.

        Output the record to the file, catering for rollover as described
        in doRollover().
        i    s   %s
i   N(   s   selfs   maxBytess   formats   records   msgs   streams   seeks   tells   lens
   doRollovers   loggings   FileHandlers   emit(   s   selfs   records   msg(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emit^   s     #(   s   __name__s
   __module__s   __init__s
   doRollovers   emit(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   RotatingFileHandler,   s   	s   SocketHandlerc           B   sM   t  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s  
    A handler class which writes logging records, in pickle format, to
    a streaming socket. The socket is kept open across logging calls.
    If the peer resets it, an attempt is made to reconnect on the next call.
    The pickle which is sent is that of the LogRecord's attribute dictionary
    (__dict__), so that the receiver does not need to have the logging module
    installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.
    c         C   s8   t  i i |  ƒ | |  _ | |  _ t |  _ d |  _ d S(   s	  
        Initializes the handler with a specific host address and port.

        The attribute 'closeOnError' is set to 1 - which means that if
        a socket error occurs, the socket is silently closed and then
        reopened on the next logging call.
        i    N(	   s   loggings   Handlers   __init__s   selfs   hosts   ports   Nones   socks   closeOnError(   s   selfs   hosts   port(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__z   s     			c         C   s9   t  i  t  i t  i ƒ } | i |  i |  i f ƒ | Sd S(   sr   
        A factory method which allows subclasses to define the precise
        type of socket they want.
        N(   s   sockets   AF_INETs   SOCK_STREAMs   ss   connects   selfs   hosts   port(   s   selfs   s(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys
   makeSocketˆ   s     c         C   s|   t  |  i d ƒ o |  i i | ƒ nR d } t | ƒ } x< | d j o. |  i i | | ƒ } | | } | | } q< Wd S(   s™   
        Send a pickled string to the socket.

        This function allows for partial sends which can happen when the
        network is busy.
        s   sendalli    N(
   s   hasattrs   selfs   socks   sendalls   ss	   sentsofars   lens   lefts   sends   sent(   s   selfs   ss   sents	   sentsofars   left(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   send‘   s      
c         C   s9   t  i | i d ƒ } t i d t | ƒ ƒ } | | Sd S(   sŒ   
        Pickles the record in binary format with a length prefix, and
        returns it ready for transmission across the socket.
        i   s   >LN(	   s   cPickles   dumpss   records   __dict__s   ss   structs   packs   lens   slen(   s   selfs   records   slens   s(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys
   makePickle¢   s     c         C   sE   |  i o |  i o |  i i ƒ  t |  _ n t i i |  | ƒ d S(   sÎ   
        Handle an error during logging.

        An error has occurred during logging. Most likely cause -
        connection lost. Close the socket so that we can retry on the
        next event.
        N(	   s   selfs   closeOnErrors   socks   closes   Nones   loggings   Handlers   handleErrors   record(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   handleError­   s
     c         C   sY   y> |  i | ƒ } |  i o |  i ƒ  |  _ n |  i | ƒ Wn |  i | ƒ n Xd S(   s  
        Emit a record.

        Pickles the record and writes it to the socket in binary format.
        If there is an error with the socket, silently drop the packet.
        If there was a problem with the socket, re-establishes the
        socket.
        N(   s   selfs
   makePickles   records   ss   socks
   makeSockets   sends   handleError(   s   selfs   records   s(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emit»   s     c         C   s(   |  i o |  i i ƒ  t |  _ n d S(   s$   
        Closes the socket.
        N(   s   selfs   socks   closes   None(   s   self(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   closeÌ   s     
(
   s   __name__s
   __module__s   __doc__s   __init__s
   makeSockets   sends
   makePickles   handleErrors   emits   close(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   SocketHandlerm   s    							s   DatagramHandlerc           B   s)   t  Z d  Z d „  Z d „  Z d „  Z RS(   s˜  
    A handler class which writes logging records, in pickle format, to
    a datagram socket.  The pickle which is sent is that of the LogRecord's
    attribute dictionary (__dict__), so that the receiver does not need to
    have the logging module installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.

    c         C   s    t  i |  | | ƒ d |  _ d S(   sP   
        Initializes the handler with a specific host address and port.
        i    N(   s   SocketHandlers   __init__s   selfs   hosts   ports   closeOnError(   s   selfs   hosts   port(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__ß   s     c         C   s    t  i  t  i t  i ƒ } | Sd S(   su   
        The factory method of SocketHandler is here overridden to create
        a UDP socket (SOCK_DGRAM).
        N(   s   sockets   AF_INETs
   SOCK_DGRAMs   s(   s   selfs   s(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys
   makeSocketæ   s     c         C   s#   |  i i | |  i |  i f ƒ d S(   só   
        Send a pickled string to a socket.

        This function no longer allows for partial sends which can happen
        when the network is busy - UDP does not guarantee delivery and
        can deliver packets out of sequence.
        N(   s   selfs   socks   sendtos   ss   hosts   port(   s   selfs   s(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   sendî   s     (   s   __name__s
   __module__s   __doc__s   __init__s
   makeSockets   send(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   DatagramHandlerÔ   s   
 		s   SysLogHandlerc           B   s  t  Z d  Z d Z d Z d Z d Z d Z d Z d Z	 d Z
 d Z d Z d Z d Z d Z d Z d Z d Z d	 Z d
 Z d Z d Z d Z d Z d Z d Z d Z d Z d Z h  d e <d e <d e <d e
 <d e <d e <d e <d e	 <d e <d e <d e <d e <Z h  d  e <d! e <d" e <d# e <d$ e <d% e <d& e <d' e <d( e <d) e <d* e <d+ e <d, e <d- e <d. e <d/ e <d0 e <d1 e <d2 e <d3 e <Z d4 e  f e d5 „ Z! d6 Z" d7 „  Z# d8 „  Z$ d9 „  Z% RS(:   s  
    A handler class which sends formatted logging records to a syslog
    server. Based on Sam Rushing's syslog module:
    http://www.nightmare.com/squirl/python-ext/misc/syslog.py
    Contributed by Nicolas Untz (after which minor refactoring changes
    have been made).
    i    i   i   i   i   i   i   i   i   i	   i
   i   i   i   i   i   i   i   i   s   alerts   crits   criticals   debugs   emergs   errs   errors   infos   notices   panics   warns   warnings   auths   authprivs   crons   daemons   kerns   lprs   mails   newss   securitys   syslogs   users   uucps   local0s   local1s   local2s   local3s   local4s   local5s   local6s   local7s	   localhostc         C   sö   t  i i |  ƒ | |  _ | |  _ t | ƒ t i j o� t	 i	 t	 i
 t	 i ƒ |  _	 y |  i	 i | ƒ Wn> t	 i j
 o/ |  i	 i ƒ  t	 i	 t	 i
 t	 i ƒ |  _	 n X|  i	 i | ƒ d |  _ n% t	 i	 t	 i t	 i ƒ |  _	 d |  _ t |  _ d S(   s¢   
        Initialize a handler.

        If address is specified as a string, UNIX socket is used.
        If facility is not specified, LOG_USER is used.
        i   i    N(   s   loggings   Handlers   __init__s   selfs   addresss   facilitys   types   typess
   StringTypes   sockets   AF_UNIXs
   SOCK_DGRAMs   connects   errors   closes   SOCK_STREAMs
   unixsockets   AF_INETs   Nones	   formatter(   s   selfs   addresss   facility(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__Q  s      		 	s   <%d>%s c         C   s^   t  | ƒ t i j o |  i | } n t  | ƒ t i j o |  i | } n | d >| BSd S(   sé   
        Encode the facility and priority. You can pass in strings or
        integers - if strings are passed, the facility_names and
        priority_names mapping dictionaries are used to convert them to
        integers.
        i   N(   s   types   facilitys   typess
   StringTypes   selfs   facility_namess   prioritys   priority_names(   s   selfs   facilitys   priority(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   encodePriorityr  s     c         C   s   |  i o |  i i ƒ  n d S(   s$   
        Closes the socket.
        N(   s   selfs
   unixsockets   sockets   close(   s   self(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   close  s     
c         C   s�   |  i | ƒ } |  i |  i |  i t i | i	 ƒ ƒ | f } y8 |  i
 o |  i i | ƒ n |  i i | |  i ƒ Wn |  i | ƒ n Xd S(   s±   
        Emit a record.

        The record is formatted, and then sent to the syslog server. If
        exception information is present, it is NOT sent to the server.
        N(   s   selfs   formats   records   msgs   log_format_strings   encodePrioritys   facilitys   strings   lowers	   levelnames
   unixsockets   sockets   sends   sendtos   addresss   handleError(   s   selfs   records   msg(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emit†  s      
(&   s   __name__s
   __module__s   __doc__s	   LOG_EMERGs	   LOG_ALERTs   LOG_CRITs   LOG_ERRs   LOG_WARNINGs
   LOG_NOTICEs   LOG_INFOs	   LOG_DEBUGs   LOG_KERNs   LOG_USERs   LOG_MAILs
   LOG_DAEMONs   LOG_AUTHs
   LOG_SYSLOGs   LOG_LPRs   LOG_NEWSs   LOG_UUCPs   LOG_CRONs   LOG_AUTHPRIVs
   LOG_LOCAL0s
   LOG_LOCAL1s
   LOG_LOCAL2s
   LOG_LOCAL3s
   LOG_LOCAL4s
   LOG_LOCAL5s
   LOG_LOCAL6s
   LOG_LOCAL7s   priority_namess   facility_namess   SYSLOG_UDP_PORTs   __init__s   log_format_strings   encodePrioritys   closes   emit(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   SysLogHandlerø   sF    rº		s   SMTPHandlerc           B   sz   t  Z d  Z d „  Z d „  Z d d d d d d d	 g Z e d
 d d d d d d d d d d d g Z d „  Z d „  Z	 RS(   sK   
    A handler class which sends an SMTP email for each logging event.
    c         C   sœ   t  i i |  ƒ t | ƒ t i j o" | \ } } | |  _ | |  _
 n | |  _ t |  _
 | |  _ t | ƒ t i j o | g } n | |  _ | |  _ d S(   sú   
        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.
        N(   s   loggings   Handlers   __init__s   selfs   types   mailhosts   typess	   TupleTypes   hosts   ports   mailports   Nones   fromaddrs   toaddrss
   StringTypes   subject(   s   selfs   mailhosts   fromaddrs   toaddrss   subjects   hosts   port(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__¢  s     					c         C   s   |  i Sd S(   sž   
        Determine the subject for the email.

        If you want to specify a subject line which is record-dependent,
        override this method.
        N(   s   selfs   subject(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys
   getSubject¸  s     s   Mons   Tues   Weds   Thus   Fris   Sats   Suns   Jans   Febs   Mars   Aprs   Mays   Juns   Juls   Augs   Seps   Octs   Novs   Decc      	   C   se   t  i t  i  ƒ  ƒ \	 } } }
 } } } } } }	 d |  i | |
 |  i | | | | | f } | Sd S(   s=   Return the current date and time formatted for a MIME header.s#   %s, %02d %3s %4d %02d:%02d:%02d GMTN(   s   times   gmtimes   years   months   days   hhs   mms   sss   wds   ys   zs   selfs   weekdaynames	   monthnames   s(   s   selfs   wds   mms   ss   months   sss   hhs   years   ys   zs   day(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys	   date_timeÇ  s     0-c         C   sÇ   y¬ d k  } |  i } | o | i } n | i |  i | ƒ } |  i | ƒ } d |  i t i |  i d ƒ |  i | ƒ |  i ƒ  | f } | i |  i |  i | ƒ | i ƒ  Wn |  i | ƒ n Xd S(   sd   
        Emit a record.

        Format the record and send it to the specified addressees.
        Ns-   From: %s
To: %s
Subject: %s
Date: %s

%ss   ,(   s   smtplibs   selfs   mailports   ports	   SMTP_PORTs   SMTPs   mailhosts   smtps   formats   records   msgs   fromaddrs   strings   joins   toaddrss
   getSubjects	   date_times   sendmails   quits   handleError(   s   selfs   records   smtps   msgs   smtplibs   port(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emitÐ  s     		:(
   s   __name__s
   __module__s   __doc__s   __init__s
   getSubjects   weekdaynames   Nones	   monthnames	   date_times   emit(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   SMTPHandlerž  s    			-		s   NTEventLogHandlerc           B   sJ   t  Z d  Z e d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   sý  
    A handler class which sends events to the NT Event Log. Adds a
    registry entry for the specified application name. If no dllname is
    provided, win32service.pyd (which contains some basic message
    placeholders) is used. Note that use of these placeholders will make
    your event logs big, as the entire message source is held in the log.
    If you want slimmer logs, you have to pass in the name of your own DLL
    which contains the message definitions you want to use in the event log.
    s   Applicationc         C   s;  t  i i |  ƒ yd  k } d  k } | |  _ | |  _ | oK t	 i
 i |  i i ƒ } t	 i
 i | d ƒ } t	 i
 i | d d ƒ } n | |  _ | |  _ |  i i | | | ƒ | i |  _ h  t  i | i <t  i | i <t  i | i <t  i | i <t  i | i <|  _ Wn! t j
 o d GHt |  _ n Xd  S(   Ni    s   win32service.pydsW   The Python Win32 extensions for NT (service, event logging) appear not to be available.(   s   loggings   Handlers   __init__s   selfs   win32evtlogutils   win32evtlogs   appnames   _welus   dllnames   oss   paths   splits   __file__s   joins   logtypes   AddSourceToRegistrys   EVENTLOG_ERROR_TYPEs   deftypes   DEBUGs   EVENTLOG_INFORMATION_TYPEs   INFOs   WARNINGs   EVENTLOG_WARNING_TYPEs   ERRORs   CRITICALs   typemaps   ImportErrors   None(   s   selfs   appnames   dllnames   logtypes   win32evtlogs   win32evtlogutil(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__ñ  s"    				Xc         C   s   d Sd S(   sy  
        Return the message ID for the event record. If you are using your
        own messages, you could do this by having the msg passed to the
        logger being an ID rather than a formatting string. Then, in here,
        you could use a dictionary lookup to get the message ID. This
        version returns 1, which is the base message ID in win32service.pyd.
        i   N(    (   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   getMessageID  s     c         C   s   d Sd S(   sž   
        Return the event category for the record.

        Override this if you want to specify your own categories. This version
        returns 0.
        i    N(    (   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   getEventCategory  s     c         C   s   |  i i | i |  i ƒ Sd S(   så  
        Return the event type for the record.

        Override this if you want to specify your own types. This version does
        a mapping using the handler's typemap attribute, which is set up in
        __init__() to a dictionary which contains mappings for DEBUG, INFO,
        WARNING, ERROR and CRITICAL. If you are using your own levels you will
        either need to override this method or place a suitable dictionary in
        the handler's typemap attribute.
        N(   s   selfs   typemaps   gets   records   levelnos   deftype(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   getEventType  s    
 c         C   s‹   |  i o} yb |  i | ƒ } |  i | ƒ } |  i | ƒ } |  i	 | ƒ } |  i i |  i | | | | g ƒ Wq‡ |  i | ƒ q‡ Xn d S(   s”   
        Emit a record.

        Determine the message ID, event category and event type. Then
        log the message in the NT event log.
        N(   s   selfs   _welus   getMessageIDs   records   ids   getEventCategorys   cats   getEventTypes   types   formats   msgs   ReportEvents   appnames   handleError(   s   selfs   records   cats   msgs   types   id(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emit+  s     
&c         C   s   d S(   sS  
        Clean up this handler.

        You can remove the application name from the registry as a
        source of event log entries. However, if you do this, you will
        not be able to see the events as you intended in the Event Log
        Viewer - it needs to be able to access the registry to get the
        DLL name.
        N(    (   s   self(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   close<  s    	 (
   s   __name__s
   __module__s   __doc__s   Nones   __init__s   getMessageIDs   getEventCategorys   getEventTypes   emits   close(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   NTEventLogHandlerç  s   	 	
				s   HTTPHandlerc           B   s,   t  Z d  Z d d „ Z d „  Z d „  Z RS(   s^   
    A class which sends records to a Web server, using either GET or
    POST semantics.
    s   GETc         C   s^   t  i i |  ƒ t i | ƒ } | d d g j o t d ‚ n | |  _ | |  _	 | |  _ d S(   sr   
        Initialize the instance with the host, the request URL, and the method
        ("GET" or "POST")
        s   GETs   POSTs   method must be GET or POSTN(
   s   loggings   Handlers   __init__s   selfs   strings   uppers   methods
   ValueErrors   hosts   url(   s   selfs   hosts   urls   method(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__N  s     		c         C   s   | i Sd S(   s´   
        Default implementation of mapping the log record into a dict
        that is send as the CGI data. Overwrite in your class.
        Contributed by Franz  Glasner.
        N(   s   records   __dict__(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   mapLogRecord[  s     c         C   s-  yd k  } d k } | i |  i ƒ } |  i } | i |  i | ƒ ƒ } |  i d j oA t i | d ƒ d j o
 d } n d } | d | | f } n | i |  i | ƒ |  i d j o  | i d t t | ƒ ƒ ƒ n | i ƒ  |  i d j o | i | ƒ n | i ƒ  Wn |  i | ƒ n Xd S(	   sh   
        Emit a record.

        Send the record to the Web server as an URL-encoded dictionary
        Ns   GETs   ?i    s   &s   %c%ss   POSTs   Content-length(   s   httplibs   urllibs   HTTPs   selfs   hosts   hs   urls	   urlencodes   mapLogRecords   records   datas   methods   strings   finds   seps
   putrequests	   putheaders   strs   lens
   endheaderss   sends   getreplys   handleError(   s   selfs   records   httplibs   seps   urls   hs   urllibs   data(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emitc  s(     	
 
(   s   __name__s
   __module__s   __doc__s   __init__s   mapLogRecords   emit(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   HTTPHandlerI  s    	s   BufferingHandlerc           B   s2   t  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   så   
  A handler class which buffers logging records in memory. Whenever each
  record is added to the buffer, a check is made to see if the buffer should
  be flushed. If it should, then flush() is expected to do what's needed.
    c         C   s&   t  i i |  ƒ | |  _ g  |  _ d S(   s>   
        Initialize the handler with the buffer size.
        N(   s   loggings   Handlers   __init__s   selfs   capacitys   buffer(   s   selfs   capacity(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__„  s     	c         C   s   t  |  i ƒ |  i j Sd S(   s¼   
        Should the handler flush its buffer?

        Returns true if the buffer is up to capacity. This method can be
        overridden to implement custom flushing strategies.
        N(   s   lens   selfs   buffers   capacity(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   shouldFlushŒ  s     c         C   s2   |  i i | ƒ |  i | ƒ o |  i ƒ  n d S(   s†   
        Emit a record.

        Append the record. If shouldFlush() tells us to, call flush() to process
        the buffer.
        N(   s   selfs   buffers   appends   records   shouldFlushs   flush(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   emit•  s     c         C   s   g  |  _ d S(   sw   
        Override to implement custom flushing behaviour.

        This version just zaps the buffer to empty.
        N(   s   selfs   buffer(   s   self(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   flush   s     (   s   __name__s
   __module__s   __doc__s   __init__s   shouldFlushs   emits   flush(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   BufferingHandler~  s
    				s   MemoryHandlerc           B   sD   t  Z d  Z e i e d „ Z d „  Z d „  Z d „  Z	 d „  Z
 RS(   sâ   
    A handler class which buffers logging records in memory, periodically
    flushing them to a target handler. Flushing occurs whenever the buffer
    is full, or when an event of a certain severity or greater is seen.
    c         C   s&   t  i |  | ƒ | |  _ | |  _ d S(   s  
        Initialize the handler with the buffer size, the level at which
        flushing should occur and an optional target.

        Note that without a target being set either here or via setTarget(),
        a MemoryHandler is no use to anyone!
        N(   s   BufferingHandlers   __init__s   selfs   capacitys
   flushLevels   target(   s   selfs   capacitys
   flushLevels   target(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   __init__®  s     	c         C   s-   t  |  i ƒ |  i j p | i |  i j Sd S(   sP   
        Check for buffer full or a record at the flushLevel or higher.
        N(   s   lens   selfs   buffers   capacitys   records   levelnos
   flushLevel(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   shouldFlushº  s     c         C   s   | |  _  d S(   s:   
        Set the target handler for this handler.
        N(   s   targets   self(   s   selfs   target(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys	   setTargetÁ  s     c         C   s?   |  i o1 x! |  i D] } |  i i | ƒ q Wg  |  _ n d S(   s±   
        For a MemoryHandler, flushing means just sending the buffered
        records to the target, if there is one. Override if you want
        different behaviour.
        N(   s   selfs   targets   buffers   records   handle(   s   selfs   record(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   flushÇ  s     

 c         C   s    |  i ƒ  t |  _ g  |  _ d S(   sD   
        Flush, set the target to None and lose the buffer.
        N(   s   selfs   flushs   Nones   targets   buffer(   s   self(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   closeÒ  s     
	(   s   __name__s
   __module__s   __doc__s   loggings   ERRORs   Nones   __init__s   shouldFlushs	   setTargets   flushs   close(    (    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   MemoryHandler¨  s    			(   s   __doc__s   syss   loggings   sockets   typess   oss   strings   cPickles   structs   times   SocketServers   ThreadingTCPServers   StreamRequestHandlers   DEFAULT_TCP_LOGGING_PORTs   DEFAULT_UDP_LOGGING_PORTs   DEFAULT_HTTP_LOGGING_PORTs   DEFAULT_SOAP_LOGGING_PORTs   SYSLOG_UDP_PORTs   FileHandlers   RotatingFileHandlers   Handlers   SocketHandlers   DatagramHandlers   SysLogHandlers   SMTPHandlers   NTEventLogHandlers   HTTPHandlers   BufferingHandlers   MemoryHandler(   s   DatagramHandlers   RotatingFileHandlers   ThreadingTCPServers   HTTPHandlers   DEFAULT_TCP_LOGGING_PORTs   structs   DEFAULT_HTTP_LOGGING_PORTs   DEFAULT_UDP_LOGGING_PORTs   SYSLOG_UDP_PORTs   DEFAULT_SOAP_LOGGING_PORTs   cPickles   strings   NTEventLogHandlers   StreamRequestHandlers   MemoryHandlers   syss   SMTPHandlers   typess   loggings   sockets   SysLogHandlers   BufferingHandlers   times   SocketHandlers   os(    (    s-   /mit/python/lib/python2.3/logging/handlers.pys   ?   s    QAg$¦Ib5*