;ò
¢)?Bc           @   s9   d  k  Z  d  k Z d k l Z d e f d „  ƒ  YZ d  S(   N(   s   Loggers   StampedLoggerc           B   s>   t  Z d  Z e d d d d „ Z d „  Z d „  Z d „  Z RS(   sF  Record messages in log files, including date stamp and optional label.

    If manual_reprime is on (off by default), then timestamp prefix will
    included only on first .write() and on any write immediately following a
    call to the .reprime() method.  This is useful for when StampedLogger is
    substituting for sys.stderr, where you'd like to see the grouping of
    multiple writes under a single timestamp (and there is often is one group,
    for uncaught exceptions where a script is bombing).

    In any case, the identifying prefix will only follow writes that start on
    a new line.

    Nofail (by default) says to fallback to sys.stderr if write fails to
    category file.  A message is emitted, but the IOError is caught.
    Initialize with nofail=0 if you want to handle the error in your code,
    instead.

    i    i   c         C   s>   | |  _ | |  _ d |  _ d |  _ t i |  | | | ƒ d S(   s„   If specified, optional label is included after timestamp.
        Other options are passed to the Logger class initializer.
        i   N(   s   labels   selfs   _StampedLogger__labels   manual_reprimes   _StampedLogger__manual_reprimes   _StampedLogger__primeds   _StampedLogger__bols   Loggers   __init__s   categorys   nofails	   immediate(   s   selfs   categorys   labels   manual_reprimes   nofails	   immediate(    (    s-   /var/mailman/Mailman/Logging/StampedLogger.pys   __init__+   s     				c         C   s   d |  _ d S(   s4   Reset so timestamp will be included with next write.i   N(   s   selfs   _StampedLogger__primed(   s   self(    (    s-   /var/mailman/Mailman/Logging/StampedLogger.pys   reprime6   s     c         C   sñ   |  i o
 d } n‘ |  i p |  i o. t i d t i t i ƒ  ƒ ƒ } d |  _ n d } |  i	 t
 j o d t i ƒ  } n d |  i	 t i ƒ  f } | | } t i |  d | | f ƒ | o | d d j o d	 |  _ n
 d |  _ d  S(
   Ns    s   %b %d %H:%M:%S %Y i    s   (%d)s   %s(%d):s   %s %siÿÿÿÿs   
i   (   s   selfs   _StampedLogger__bols   prefixs   _StampedLogger__manual_reprimes   _StampedLogger__primeds   times   strftimes	   localtimes   stamps   _StampedLogger__labels   Nones   oss   getpids   labels   Loggers   writes   msg(   s   selfs   msgs   stamps   labels   prefix(    (    s-   /var/mailman/Mailman/Logging/StampedLogger.pys   write:   s    
	
c         C   s‚   d } xu | D]m } | o |  i | ƒ d } q | o | d d d d g j o t i |  d | ƒ q t i |  | ƒ q Wd  S(   Ni   i    s    s   	s   
(   s   firsts   liness   ls   selfs   writes   Logger(   s   selfs   liness   ls   first(    (    s-   /var/mailman/Mailman/Logging/StampedLogger.pys
   writelinesO   s     
!(   s   __name__s
   __module__s   __doc__s   Nones   __init__s   reprimes   writes
   writelines(    (    (    s-   /var/mailman/Mailman/Logging/StampedLogger.pys   StampedLogger   s
    		(   s   oss   times   Mailman.Logging.Loggers   Loggers   StampedLogger(   s   Loggers   StampedLoggers   oss   time(    (    s-   /var/mailman/Mailman/Logging/StampedLogger.pys   ?   s   		