b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / logging /
Filename/usr/lib64/python2.6/logging/config.pyo
Size10.63 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 13:08
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sJdZddkZddkZddkZddkZddkZddkZddkZddkZddk Z yddk
Z
ddk Z Wne j
o
dZ
nXddklZlZdZeidjo
dZndZdaddd �Zd
�Zd �Zd �Zd
�Zd�Zd�Zed�Zd�ZdS(s�
Configuration functions for the logging package for Python. The core package
is 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 'sys._getframe()' is.

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

To use, simply 'import logging' and log away!
iÿÿÿÿN(tThreadingTCPServertStreamRequestHandleriF#twin32iF'ihicCs¸ddk}|i|�}t|d�o!t|d�o|i|�n|i|�t|�}ti�z7tii�ti 2t
||�}t |||�Wdti �XdS(s5
Read the logging configuration from a ConfigParser-format file.

This can be called several times from an application, allowing an end user
the ability to select from various pre-canned configurations (if the
developer provides a mechanism to present the choices and load the chosen
configuration).
In versions of ConfigParser which have the readfp method [typically
shipped in 2.x versions of Python], you can pass in a file-like object
rather than a filename, in which case the file-like object will be read
using readfp.
iÿÿÿÿNtreadfptreadline(
t ConfigParserthasattrRtreadt_create_formatterstloggingt _acquireLockt _handlerstcleart _handlerListt_install_handlerst_install_loggerst _releaseLock(tfnametdefaultstdisable_existing_loggersRtcpt
formattersthandlers((s&/usr/lib64/python2.6/logging/config.pyt
fileConfig7s
 
 

cCs�ti|d�}|id�}t|�}x^|D]V}|d|}yt||�}Wq4tj
o t|�t||�}q4Xq4W|S(s)Resolve a dotted name to a global object.t.i(tstringtsplittpopt
__import__tgetattrtAttributeError(tnametusedtfoundtn((s&/usr/lib64/python2.6/logging/config.pyt_resolveZs 
cCstd�|�S(NcSs
ti|�S((Rtstrip(tx((s&/usr/lib64/python2.6/logging/config.pyt<lambda>is(tmap(talist((s&/usr/lib64/python2.6/logging/config.pyt
_strip_spaceshscCs"t|t�o|S|id�S(Nsutf-8(t
isinstancetstrtencode(ts((s&/usr/lib64/python2.6/logging/config.pyt_encodedksc Cs*|idd�}t|�phSti|d�}t|�}h}xÛ|D]Ó}d|}|i|�}d|jo|i|dd�}nd }d|jo|i|dd�}nd }ti}d|jo-|i|d�} | ot | �}q n|||�}
|
||<qOW|S(
sCreate and return formattersRtkeyst,s formatter_%stformatitdatefmttclassN(
tgettlenRRR)toptionstNoneR t FormatterR#( RtflistRtformtsectnametoptstfstdfstct
class_nametf((s&/usr/lib64/python2.6/logging/config.pyRns0
 


 
cCs|idd�}t|�phSti|d�}t|�}h}g}x |D]�}d|}|i|d�}|i|�}d|jo|i|d�} nd} yt|tt��}Wn%t t
fj
ot |�}nX|i|d�}
t|
tt��}
||
�} d |jo*|i|d �} | i ti
| �nt| �o| i|| �nt|tii�oQd
|jo|i|d
�}
nd}
t|
�o|i| |
f�qãn| ||<qUWx%|D]\} }| i||�qøW|S( sInstall and return handlersRR/R0s
handler_%sR3t formatterttargstlevelttarget(R4R5RRR)R6tevaltvarsR Rt NameErrorR#tsetLevelt _levelNamest setFormattert
issubclassRt
MemoryHandlertappendt setTarget(RRthlistRtfixupsthandR;tklassR<tfmtRDthRERFtt((s&/usr/lib64/python2.6/logging/config.pyR�sL
 

 



 cCs�|idd�}ti|d�}td�|�}|id�d}ti}|}|i|�}d|jo*|i|d�}|iti |�nx|i
D]} |i | �q©W|i|d�}
t |
�oDti|
d�}
t
|
�}
x#|
D]} |i|| �qWn|iii�} | id t�g}
xÝ|D]Õ}d
|}|i|d �}|i|�}d |jo|i|d �}nd
}ti|�}|| jo�| i|�}|d}t |�}t | �}|d
}xB||jo4| || |jo|
i| |�|d
}qW| i|�nd|jo*|i|d�}|iti |�nx|i
D]} |i | �q�W||_d|_|i|d�}
t |
�oDti|
d�}
t
|
�}
x#|
D]} |i|| �qWqRqRWxa| D]Y}|ii|}||
jo"ti|_g|_
d
|_q2|o
d
|_q2q2WdS(sCreate and install loggerstloggersR/R0cSs
ti|�S((RR$(R%((s&/usr/lib64/python2.6/logging/config.pyR&¼stroott logger_rootRERtkeys logger_%stqualnamet propagateiRiN(R4RRR'tremoveR RYR6RJRKRt
removeHandlerR5R)t
addHandlertmanagert
loggerDictR/tsortR.tgetintt getLoggertindexROR]tdisabledtNOTSETRE(RRRtllistR;RYtlogR<RERVRQRStexistingt
child_loggerstqnR]tloggertitprefixedtpflent num_existing((s&/usr/lib64/python2.6/logging/config.pyR¶s�
 
 
  



  
"
   
 
  
cCshtp
td�ndtfd��Y}dtfd��Y}d�}tid|d|||f�S( sW
Start up a socket server on the specified port, and listen for new
configurations.

These will be sent as a file suitable for processing by fileConfig().
Returns a Thread object on which you can call start() to start the server,
and which you can join() when appropriate. To stop the server, call
stopListening().
s listen() needs threading to worktConfigStreamHandlercBseZdZd�ZRS(s¤
Handler for a logging configuration request.

It expects a completely new logging configuration and uses fileConfig
to install it.
c
Ss~ddk}y|i}|id�}t|�djoãtid|�d}|ii|�}x5t|�|jo!||i|t|��}qeW|id�}t|d�}|i|�|i �yt
|�Wn,t t fj
o
�nt
i�nXti|�nWnYtij
oJ}t|i�tijo�qz|id}|tjo�qznXdS(sè
Handle a request.

Each request is expected to be a 4-byte length, packed using
struct.pack(">L", n), followed by the config file.
Uses fileConfig() to do the grunt work.
iÿÿÿÿNis>Lis.initw(ttempfilet
connectiontrecvR5tstructtunpacktmktemptopentwritetcloseRtKeyboardInterruptt
SystemExitt tracebackt print_exctosR^tsocketterrorttypeRDttypest TupleTypet RESET_ERROR( tselfRutconntchunktslentfileRAteterrcode((s&/usr/lib64/python2.6/logging/config.pythandle%s6  "



(t__name__t
__module__t__doc__R�(((s&/usr/lib64/python2.6/logging/config.pyRsstConfigSocketReceivercBs/eZdZdZdedd�Zd�ZRS(sD
A simple TCP socket-based logging config receiver.
it localhostcSsCti|||f|�ti�d|_ti�d|_dS(Nii(Rt__init__R R
tabortRttimeout(R�thosttportthandler((s&/usr/lib64/python2.6/logging/config.pyR�Us

 
cSs�ddk}d}xn|pf|i|ii�ggg|i�\}}}|o|i�nti�|i}ti�qWdS(Niÿÿÿÿi( tselectR�tfilenoR�thandle_requestR R
R�R(R�R�R�trdtwrtex((s&/usr/lib64/python2.6/logging/config.pytserve_until_stopped]s 
 N(R�R�R�tallow_reuse_addresstDEFAULT_LOGGING_CONFIG_PORTR7R�R¢(((s&/usr/lib64/python2.6/logging/config.pyR�Ns
 cSs=|d|d|�}ti�|ati�|i�dS(NR�R�(R R
t _listenerRR¢(trcvrthdlrR�tserver((s&/usr/lib64/python2.6/logging/config.pytservejs


RFRD(tthreadtNotImplementedErrorRRt threadingtThread(R�RsR�R©((s&/usr/lib64/python2.6/logging/config.pytlistens

0 cCs2to'ti�dt_dati�ndS(sN
Stop the listening server which was created with a call to listen().
iN(R¥R R
R�R7R(((s&/usr/lib64/python2.6/logging/config.pyt
stopListeningvs

 (R�tsysR tlogging.handlersRR�RxR�R�R�RªR¬t ImportErrorR7t SocketServerRRR¤tplatformR�R¥RR#R)R.RRRR®R¯(((s&/usr/lib64/python2.6/logging/config.pyt<module>s*l  
#     + [ e