Viewing File: /usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyc

ó
)¿Úhc@swdZddlZddlZddlZddlmZddlmZddlm	Z	dZ
dd	d„ƒYZdS(
sDFile-based logger, writes to named category files in mm_cfg.LOG_DIR.iÿÿÿÿN(t
StringType(tmm_cfg(t_logexcs
iso-8859-1tLoggercBsVeZddd„Zd„Zd„Zd„Zd„Zd„Zd„Zd	„Z	RS(
iicCsYtjjtj|ƒ|_d|_||_t	p<t
jƒ|_|rU|j
ƒndS(s{nofail says to fallback to sys.__stderr__ if write fails to
        category file - a complaint message is emitted, but no exception is
        raised.  Set nofail=0 if you want to handle the error in your code,
        instead.

        immediate=1 says to create the log file on instantiation.
        Otherwise, the file is created only when there are writes pending.
        N(tostpathtjoinRtLOG_DIRt_Logger__filenametNonet_Logger__fpt_Logger__nofailtLOG_ENCODINGtsystgetdefaultencodingt_Logger__encodingt_Logger__get_f(tselftcategorytnofailt	immediate((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyt__init__$s			cCs|jƒdS(N(tclose(R((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyt__del__4scCsd|jj|j
fS(Ns
<%s to %s>(t	__class__t__name__R(R((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyt__repr__7scCsÙ|jr|jSytjdƒ}z[y%tj|jd|jddƒ}Wn&tk
rrt|jddƒ}nX||_Wdtj|ƒXWn?tk
rÐ}|j	rÊt
||ƒtj}|_qÑ‚nX|SdS(Nisa+treplacei(
R
RtumasktcodecstopenRRtLookupErrortIOErrorRRR
t
__stderr__(Rtoutfte((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyt__get_f:s&	


	
cCs,|jƒ}t|dƒr(|jƒndS(Ntflush(RthasattrR&(RR#((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyR&RscCskt|tƒr't||jdƒ}n|jƒ}y|j|ƒWn tk
rf}t||ƒnXdS(NR(t
isinstanceRtunicodeRRtwriteR R(RtmsgR#((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyR*WscCs"x|D]}|j|ƒqWdS(N(R*(Rtlinestl((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyt
writelines`s
cCs*|js
dS|jƒjƒd|_dS(N(R
RRR	(R((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyRds	(
Rt
__module__RRRRR&R*R.R(((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyR#s							((t__doc__R
RRttypesRtMailmanRtMailman.Logging.UtilsRRR(((s</usr/local/cpanel/3rdparty/mailman/Mailman/Logging/Logger.pyt<module>s
Back to Directory File Manager