/opt/alt/python311/lib64/python3.11/logging/__pycache__
NameSizeModeActions
config.cpython-311.opt-1.pyc448520644editdlrm
config.cpython-311.opt-2.pyc408870644editdlrm
config.cpython-311.pyc449300644editdlrm
handlers.cpython-311.opt-1.pyc702090644editdlrm
handlers.cpython-311.opt-2.pyc511860644editdlrm
handlers.cpython-311.pyc702090644editdlrm
__init__.cpython-311.opt-1.pyc987390644editdlrm
__init__.cpython-311.opt-2.pyc699660644editdlrm
__init__.cpython-311.pyc988050644editdlrm
Edit: /opt/alt/python311/lib64/python3.11/logging/__pycache__/handlers.cpython-311.opt-1.pyc (70209B)
§ —½±Ybƒ_¢ãót—dZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z ddl Z ddlZddlZdZdZdZdZdZdZd ZGd „d ej¦«ZGd „d e¦«ZGd„de¦«ZGd„dej¦«ZGd„dej¦«ZGd„de¦«ZGd„dej¦«ZGd„dej¦«Z Gd„dej¦«Z!Gd„dej¦«Z"Gd„dej¦«Z#Gd „d!e#¦«Z$Gd"„d#ej¦«Z%Gd$„d%e&¦«Z'dS)&zû Additional handlers for the logging package for Python. The core package is based on PEP 282 and comments thereto in comp.lang.python. Copyright (C) 2001-2021 Vinay Sajip. All Rights Reserved. To use, simply 'import logging.handlers' and log away! éN)ÚST_DEVÚST_INOÚST_MTIMEi<#i=#i>#i?#ié€Qcó4—eZdZdZdZdZdd„Zd„Zd„Zd„Z dS) ÚBaseRotatingHandlerz¹ Base class for handlers that rotate log files at a certain point. Not meant to be instantiated directly. Instead, use RotatingFileHandler or TimedRotatingFileHandler. NFcóz—tj ||||||¬¦«||_||_||_dS)zA Use the specified filename for streamed logging ©ÚmodeÚencodingÚdelayÚerrorsN)ÚloggingÚ FileHandlerÚ__init__r r r©ÚselfÚfilenamer r r rs ú7/opt/alt/python311/lib64/python3.11/logging/handlers.pyrzBaseRotatingHandler.__init__6sM€õ Ô×$Ò$ T¨8¸$Ø.6¸eØ,2ð %ñ 4ô 4ð 4ðˆŒ Ø ˆŒ ؈Œ ˆ ˆ ócóæ— | |¦«r| ¦«tj ||¦«dS#t $r| |¦«YdSwxYw)z„ Emit a record. Output the record to the file, catering for rollover as described in doRollover(). N)ÚshouldRolloverÚ doRolloverrrÚemitÚ ExceptionÚ handleError©rÚrecords rrzBaseRotatingHandler.emitAs„€ð %Ø×"Ò" 6Ñ*Ô*ð "Ø—’Ñ!Ô!Ð!Ý Ô × $Ò $ T¨6Ñ 2Ô 2Ð 2Ð 2Ð 2øÝð %ð %ð %Ø × Ò ˜VÑ $Ô $Ð $Ð $Ð $Ð $ð %øøøs‚A A Á A0Á/A0có^—t|j¦«s|}n| |¦«}|S)a¹ Modify the filename of a log file when rotating. This is provided so that a custom filename can be provided. The default implementation calls the 'namer' attribute of the handler, if it's callable, passing the default name to it. If the attribute isn't callable (the default is None), the name is returned unchanged. :param default_name: The default name for the log file. )ÚcallableÚnamer)rÚ default_nameÚresults rÚrotation_filenamez%BaseRotatingHandler.rotation_filenameOs3€õ˜œ Ñ#Ô#ð .Ø!ˆFˆFà—Z’Z  Ñ-Ô-ˆF؈ rcóÊ—t|j¦«s8tj |¦«rtj||¦«dSdS| ||¦«dS)aL When rotating, rotate the current log. The default implementation calls the 'rotator' attribute of the handler, if it's callable, passing the source and dest arguments to it. If the attribute isn't callable (the default is None), the source is simply renamed to the destination. :param source: The source filename. This is normally the base filename, e.g. 'test.log' :param dest: The destination filename. This is normally what the source is rotated to, e.g. 'test.log.1'. N)r ÚrotatorÚosÚpathÚexistsÚrename)rÚsourceÚdests rÚrotatezBaseRotatingHandler.rotatebsj€õ˜œ Ñ%Ô%ð 'åŒw�~Š~˜fÑ%Ô%ð (Ý” ˜& $Ñ'Ô'Ð'Ð'Ð'ð (ð (ð �LŠL˜ Ñ &Ô &Ð &Ð &Ð &r)NFN) Ú__name__Ú __module__Ú __qualname__Ú__doc__r!r&rrr$r-©rrrr-sk€€€€€ððð €EØ€Gð ð ð ð ð %ð %ð %ðððð&'ð'ð'ð'ð'rrcó*—eZdZdZ d d„Zd„Zd„ZdS) ÚRotatingFileHandlerz‹ Handler for logging to a set of files, which switches from one file to the next when the current file reaches a certain size. ÚarNFcó¢—|dkrd}d|vrtj|¦«}t ||||||¬¦«||_||_dS)aú 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. rr5Úb©r r rN)ÚioÚ text_encodingrrÚmaxBytesÚ backupCount)rrr r;r<r r rs rrzRotatingFileHandler.__init__|sm€ð6 �aŠ<ˆ<؈DØ �dˆ?ˆ?ÝÔ'¨Ñ1Ô1ˆHÝ×$Ò$ T¨8°TÀHØ+0¸ð %ñ Aô Að Aà ˆŒ Ø&ˆÔÐÐrcó—|jr |j ¦«d|_|jdk�r/t|jdz dd¦«D]ª}| d|j|fz¦«}| d|j|dzfz¦«}t j |¦«rHt j |¦«rt j |¦«t j ||¦«Œ«| |jdz¦«}t j |¦«rt j |¦«|  |j|¦«|j s|  ¦«|_dSdS)z< Do a rollover, as described in __init__(). Nrééÿÿÿÿz%s.%dz.1)ÚstreamÚcloser<Úranger$Ú baseFilenamer'r(r)Úremover*r-r Ú_open)rÚiÚsfnÚdfns rrzRotatingFileHandler.doRollover sq€ð Œ;ð Ø ŒK× Ò Ñ Ô Ð ØˆDŒKØ Ô ˜aÒ Ñ Ý˜4Ô+¨aÑ/°°BÑ7Ô7ð (ð (�Ø×,Ò,¨W¸Ô8IÈ1Ð7MÑ-MÑNÔN�Ø×,Ò,¨W¸Ô8IØ89¸A¹ð8?ñ.?ñ@ô@�å”7—>’> #Ñ&Ô&ð(Ý”w—~’~ cÑ*Ô*ð'Ýœ  #™œ˜Ý”I˜c 3Ñ'Ô'Ð'øØ×(Ò(¨Ô):¸TÑ)AÑBÔBˆCÝŒw�~Š~˜cÑ"Ô"ð Ý” ˜#‘”�Ø �KŠK˜Ô)¨3Ñ /Ô /Ð /ØŒzð 'ØŸ*š*™,œ,ˆDŒKˆKˆKð 'ð 'rcó¾—tj |j¦«r&tj |j¦«sdS|j€| ¦«|_|jdkrgd| |¦«z}|j  dd¦«|j  ¦«t|¦«z|jkrdSdS)z£ Determine if rollover should occur. Basically, see if the supplied record would cause the file to exceed the size limit we have. FNrz%s éT) r'r(r)rCÚisfiler@rEr;ÚformatÚseekÚtellÚlen©rrÚmsgs rrz"RotatingFileHandler.shouldRollover·s¼€õ Œ7�>Š>˜$Ô+Ñ ,Ô ,ð µR´W·^²^ÀDÔDUÑ5VÔ5Vð Ø�5Ø Œ;Ð ØŸ*š*™,œ,ˆDŒKØ Œ=˜1Ò Ð Ø˜4Ÿ;š; vÑ.Ô.Ñ.ˆCØ ŒK× Ò ˜Q Ñ "Ô "Ð "ØŒ{×ÒÑ!Ô!¥C¨¡H¤HÑ,°´ Ò=Ð=Ø�t؈ur)r5rrNFN)r.r/r0r1rrrr2rrr4r4ws[€€€€€ðððDEØ48ð"'ð"'ð"'ð"'ðH'ð'ð'ð.ððððrr4có8—eZdZdZ d d„Zd„Zd „Zd „Zd „ZdS) ÚTimedRotatingFileHandlerzÜ Handler for logging to a file, rotating the log file at certain timed intervals. If backupCount is > 0, when rollover is done, no more than backupCount files are kept - the oldest ones are deleted. Úhr>rNFc ó¼—tj|¦«}t ||d||| ¬¦«| ¦«|_||_||_||_|jdkrd|_ d|_ d} �n)|jdkrd|_ d |_ d } �n |jd krd |_ d |_ d} nð|jdks |jdkrd|_ d|_ d} nÉ|j  d¦«r˜d|_ t|j¦«dkrtd|jz¦«‚|jddks|jddkrtd|jz¦«‚t|jd¦«|_d|_ d} ntd|jz¦«‚t!j| t j¦«|_|j |z|_ |j}t*j |¦«r t+j|¦«t2} n tt5j¦«¦«} | | ¦«|_dS)Nr5r8ÚSr>z%Y-%m-%d_%H-%M-%Sz0(?ˆHˆHØ ŒY˜#Ò Ð  ¤¨jÒ!8Ð!8Ø(ˆDŒMØ$ˆDŒKØ8ˆHˆHØ ŒY× !Ò ! #Ñ &Ô &ð TØ,ˆDŒMÝ�4”9‰~Œ~ Ò"Ð"Ý Ð!kÐnrÔnwÑ!wÑxÔxÐxØŒy˜Œ|˜cÒ!Ð! T¤Y¨q¤\°CÒ%7Ð%7Ý Ð!PÐSWÔS\Ñ!\Ñ]Ô]Ð]Ý  ¤¨1¤Ñ.Ô.ˆDŒNØ$ˆDŒKØ8ˆHˆHåÐFÈÌÑRÑSÔSÐ Sõœ  8­R¬XÑ6Ô6ˆŒ Øœ ¨Ñ0ˆŒ ðÔ$ˆÝ Œ7�>Š>˜(Ñ #Ô #ð !Ý”˜Ñ!Ô!¥(Ô+ˆAˆAå•D”I‘K”KÑ Ô ˆAØ×.Ò.¨qÑ1Ô1ˆŒˆˆrcó�—||jz}|jdks|j d¦«�r•|jrt j|¦«}nt j|¦«}|d}|d}|d}|d}|j€t}n,|jj dz|jj zdz|jj z}||dz|zdz|zz } | d kr| tz } |d zd z}|| z}|j d¦«rV|} | |j kr3| |j kr |j | z } nd| z |j zd z} || tzz }||jtd zz z }n||jtz z }|jsS|d } t j|¦«d } | | kr+| s"d }t j|dz ¦«d sd }nd}||z }|S)zI Work out the rollover time based on the specified time. r\r]ééééNrXrr>ér?éðñÿÿrZ) rdrarfrbroÚgmtimeÚ localtimercÚ _MIDNIGHTÚhourÚminuteÚsecondri)rÚ currentTimer#rrÚ currentHourÚ currentMinuteÚ currentSecondÚ currentDayÚ rotate_tsÚrÚdayÚ daysToWaitÚdstNowÚ dstAtRolloverÚaddends rrpz(TimedRotatingFileHandler.computeRollovers€ð˜tœ}Ñ,ˆð Œ9˜ Ò "Ð " d¤i×&:Ò&:¸3Ñ&?Ô&?Ñ "àŒxð 0Ý”K  Ñ,Ô,��å”N ;Ñ/Ô/�ؘAœ$ˆKؘaœDˆMؘaœDˆMؘ1œˆJàŒ{Ð"Ý%� � à"œkÔ.°Ñ3°d´kÔ6HÑHÈ"ÑLØ”KÔ&ñ'� ð˜k¨BÑ.°Ñ>À"ÑDØññˆAà�AŠvˆvð•Y‘�Ø(¨1™n°Ñ1� Ø  1‘_ˆFð Œy×#Ò# CÑ(Ô(ð 4Ø �ؘ$œ.Ò(Ð(ؘTœ^Ò+Ð+Ø%)¤^°cÑ%9˜ ˜ à%&¨¡W¨t¬~Ñ%=ÀÑ%A˜ ؘj­9Ñ4Ñ4�Fؘ$œ-­)°a©-Ñ7Ñ7��à˜$œ-­)Ñ3Ñ3�Ø”8ð %ؘ2œ�Ý $¤¨vÑ 6Ô 6°rÔ :� ؘ]Ò*Ð*Ø!ð&Ø!&˜Ý#œ~¨f°T©kÑ:Ô:¸2Ô>ð'Ø%&˜Føà!%˜Ø˜fÑ$�F؈ rcó(—ttj¦«¦«}||jkrftj |j¦«r@tj |j¦«s| |¦«|_dSdSdS)z± Determine if rollover should occur. record is not used, as we are just comparing times, but it is needed so the method signatures are the same FT) rhrorqr'r(r)rCrKrp)rrrrs rrz'TimedRotatingFileHandler.shouldRolloverbs{€õ •” ‘ ” Ñ Ô ˆØ �”Ò Ð åŒw�~Š~˜dÔ/Ñ0Ô0ð ½¼¿ºÈÔHYÑ9ZÔ9Zð ð#'×"6Ò"6°qÑ"9Ô"9�”Ø�uà�4؈urcóÈ—tj |j¦«\}}tj|¦«}g}|j€|dz}t |¦«}|D]g}|d|…|krW||d…}|j |¦«r3|  tj  ||¦«¦«ŒhnÐ|D]Í}|j  |¦«} | r¯| |jdz| dz¦«} tj  | ¦«|kr4|  tj  ||¦«¦«n2|j  ||   ¦«dz¦«} | °¯ŒÎt |¦«|jkrg}n3| ¦«|dt |¦«|jz …}|S)z� Determine the files to delete when rolling over. More specific than the earlier method, which just used glob.glob(). Nú.rr>)r'r(ÚsplitrCÚlistdirr!rOrmÚ fullmatchÚappendÚjoinÚsearchÚbasenameÚstartr<Úsort) rÚdirNameÚbaseNameÚ fileNamesr#ÚprefixÚplenÚfileNamereÚmrHs rÚgetFilesToDeletez)TimedRotatingFileHandler.getFilesToDeleteusÓ€õ œGŸMšM¨$Ô*;Ñ<Ô<ш�Ý”J˜wÑ'Ô'ˆ ØˆØ Œ:Ð Ø ‘^ˆFÝ�v‘;”;ˆDØ%ð Gð G�ؘE˜T˜E”? fÒ,Ð,Ø% d e eœ_�FØ”}×.Ò.¨vÑ6Ô6ðGØŸ š ¥b¤g§l¢l°7¸HÑ&EÔ&EÑFÔFÐFøð  Gð &ð Fð F�ð ”M×(Ò(¨Ñ2Ô2�ØðFØŸ*š* TÔ%6¸Ñ%<¸qÀ¼tÑ%CÑDÔD�CÝ”w×'Ò'¨Ñ,Ô,°Ò8Ð8ØŸ š ¥b¤g§l¢l°7¸HÑ&EÔ&EÑFÔFÐFØØœ ×,Ò,¨X°q·w²w±y´yÀ1±}ÑEÔE�Að ðFøõ ˆv‰;Œ;˜Ô)Ò )Ð )؈FˆFà �KŠK‰MŒMˆMØÐ;�S ™[œ[¨4Ô+;Ñ;Ð;Ô<ˆF؈ rcóf—ttj¦«¦«}|j|jz }|jrtj|¦«}nZtj|¦«}tj|¦«d}|d}||kr|rd}nd}tj||z¦«}| |jdztj |j |¦«z¦«}tj   |¦«rdS|jr |j ¦«d|_| |j|¦«|jdkr+| ¦«D]}tj|¦«Œ|js| ¦«|_| |¦«|_dS)ax do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove the one with the oldest suffix. r?rZryrŽNr)rhrorqrdrbrzr{r$rCÚstrftimerer'r(r)r@rAr-r<rŸrDr rErp) rr€rrÚ timeTupler‰ÚdstThenr‹rHÚss rrz#TimedRotatingFileHandler.doRollover›s•€õ�$œ)™+œ+Ñ&Ô&ˆ Ø ŒO˜dœmÑ +ˆØ Œ8ð 7Ýœ  A™œˆIˆI圠qÑ)Ô)ˆIÝ”^ KÑ0Ô0°Ô4ˆFØ ”mˆGØ˜Ò Ð Øð#Ø!�F�Fà"�FÝ œN¨1¨v©:Ñ6Ô6� Ø×$Ò$ TÔ%6¸Ñ%<Ý%)¤]°4´;À Ñ%JÔ%Jñ&KñLôLˆå Œ7�>Š>˜#Ñ Ô ð à ˆFà Œ;ð Ø ŒK× Ò Ñ Ô Ð ØˆDŒKØ � Š �DÔ% sÑ+Ô+Ð+Ø Ô ˜aÒ Ð Ø×*Ò*Ñ,Ô,ð ð �Ý” ˜!‘ ” � � ØŒzð 'ØŸ*š*™,œ,ˆDŒKØ×.Ò.¨{Ñ;Ô;ˆŒˆˆr)rTr>rNFFNN) r.r/r0r1rrprrŸrr2rrrSrSÊs…€€€€€ðððDEØ?CØðA2ðA2ðA2ðA2ðFKðKðKðZððð&$ð$ð$ðL&<ð&<ð&<ð&<ð&@g@) rÚHandlerrÚhostÚportÚaddressÚsockÚ closeOnErrorÚ retryTimeÚ retryStartÚretryMaxÚ retryFactor©rrºr»s rrzSocketHandler.__init__su€õ Œ× Ò  Ñ&Ô&Ð&؈Œ ؈Œ Ø ˆ<؈DŒLˆLà  $˜<ˆDŒL؈Œ Ø!ˆÔ؈ŒðˆŒØˆŒ ؈ÔÐÐrr>cóF—|j�tj|j|¬¦«}n}tjtjtj¦«}| |¦« | |j¦«n##t$r|  ¦«‚wxYw|S)zr A factory method which allows subclasses to define the precise type of socket they want. N©Útimeout) r»ÚsocketÚcreate_connectionr¼ÚAF_UNIXÚ SOCK_STREAMÚ settimeoutÚconnectÚOSErrorrA)rrÆr#s rÚ makeSocketzSocketHandler.makeSocket3s�€ð Œ9Ð ÝÔ-¨d¬lÀGÐLÑLÔLˆFˆFå”]¥6¤>µ6Ô3EÑFÔFˆFØ × Ò ˜gÑ &Ô &Ð &ð Ø—’˜tœ|Ñ,Ô,Ð,Ð,øÝð ð ð Ø— ’ ‘”�Øð øøøðˆ s Á#A>Á> Bcóh—tj¦«}|j€d}n ||jk}|r‡ | ¦«|_d|_dS#t$rW|j€ |j|_n0|j|jz|_|j|jkr |j|_||jz|_YdSwxYwdS)zÌ Try to create a socket, using an exponential backoff with a max retry time. Thanks to Robert Olson for the original patch (SF #815911) which has been slightly refactored. NT) ror¿rÎr½rÍrÀÚ retryPeriodrÂrÁ)rÚnowÚattempts rÚ createSocketzSocketHandler.createSocketDsÑ€õ Œi‰kŒkˆð Œ>Ð !؈GˆGà˜dœnÒ,ˆGØ ð 8ð 8Ø ŸOšOÑ-Ô-�” Ø!%�”��øÝð 8ð 8ð 8à”>Ð)Ø'+¤�DÔ$Ð$à'+Ô'7¸$Ô:JÑ'J�DÔ$ØÔ'¨$¬-Ò7Ð7Ø+/¬=˜Ô(Ø!$ tÔ'7Ñ!7�”���ð 8øøøð 8ð 8s¬ AÁAB/Â.B/cóæ—|j€| ¦«|jrN |j |¦«dS#t$r$|j ¦«d|_YdSwxYwdS)z™ Send a pickled string to the socket. This function allows for partial sends which can happen when the network is busy. N)r½rÓÚsendallrÍrA©rr¤s rÚsendzSocketHandler.send`s�€ð Œ9Ð Ø × Ò Ñ Ô Ð ð Œ9ð !ð !Ø” ×!Ò! !Ñ$Ô$Ð$Ð$Ð$øÝð !ð !ð !Ø” —’Ñ!Ô!Ð!Ø �” � � � ð !øøøð !ð !s¤AÁ*A.Á-A.cóL—|j}|r| |¦«}t|j¦«}| ¦«|d<d|d<d|d<| dd¦«t j|d¦«}tj dt|¦«¦«}||zS)zŒ Pickles the record in binary format with a length prefix, and returns it ready for transmission across the socket. rQNÚargsÚexc_infoÚmessager>z>L) rÚrLÚdictÚ__dict__Ú getMessageÚpopÚpickleÚdumpsÚstructÚpackrO)rrÚeiÚdummyÚdr¤Úslens rÚ makePicklezSocketHandler.makePickless¡€ð Œ_ˆØ ð (à—K’K Ñ'Ô'ˆEõ �”Ñ !Ô !ˆØ×$Ò$Ñ&Ô&ˆˆ%‰Øˆˆ&‰ ؈ˆ*‰ à �Šˆi˜ÑÔÐÝ ŒL˜˜AÑ Ô ˆÝŒ{˜4¥ Q¡¤Ñ(Ô(ˆØ�a‰xˆrcó¦—|jr)|jr"|j ¦«d|_dStj ||¦«dS)zÎ 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)r¾r½rArr¹rrs rrzSocketHandler.handleError‰sS€ð Ô ð 6 ¤ð 6Ø ŒI�OŠOÑ Ô Ð ØˆDŒIˆIˆIå ŒO× 'Ò '¨¨fÑ 5Ô 5Ð 5Ð 5Ð 5rcó¨— | |¦«}| |¦«dS#t$r| |¦«YdSwxYw)a 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)rèr×rr)rrr¤s rrzSocketHandler.emit—sc€ð %Ø—’ Ñ'Ô'ˆAØ �IŠI�a‰LŒLˆLˆLˆLøÝð %ð %ð %Ø × Ò ˜VÑ $Ô $Ð $Ð $Ð $Ð $ð %øøøs‚*.®AÁAcó—| ¦« |j}|rd|_| ¦«tj |¦«| ¦«dS#| ¦«wxYw©z$ Closes the socket. N)Úacquirer½rArr¹Úrelease©rr½s rrAzSocketHandler.close¦sr€ð � Š ‰Œˆð Ø”9ˆDØð Ø �” Ø— ’ ‘ ” � Ý ŒO× !Ò ! $Ñ 'Ô 'Ð 'à �LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøøó –AA/Á/BN)r>) r.r/r0r1rrÎrÓr×rèrrrAr2rrr·r· s›€€€€€ð ð ðððð2ðððð"8ð8ð8ð8!ð!ð!ð&ððð, 6ð 6ð 6ð %ð %ð %ð ð ð ð ð rr·có$—eZdZdZd„Zd„Zd„ZdS)ÚDatagramHandlera˜ 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óL—t |||¦«d|_dS)zP Initializes the handler with a specific host address and port. FN)r·rr¾rÃs rrzDatagramHandler.__init__¿s*€õ ×Ò˜t T¨4Ñ0Ô0Ð0Ø!ˆÔÐÐrcó„—|j€ tj}n tj}tj|tj¦«}|S)zu The factory method of SocketHandler is here overridden to create a UDP socket (SOCK_DGRAM). )r»rÇrÉÚAF_INETÚ SOCK_DGRAM)rÚfamilyr¤s rrÎzDatagramHandler.makeSocketÆs5€ð Œ9Ð Ý”^ˆFˆFå”^ˆFÝ ŒM˜&¥&Ô"3Ñ 4Ô 4ˆØˆrcó|—|j€| ¦«|j ||j¦«dS)zó 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)r½rÓÚsendtor¼rÖs rr×zDatagramHandler.sendÒs>€ð Œ9Ð Ø × Ò Ñ Ô Ð Ø Œ ×Ò˜˜DœLÑ)Ô)Ð)Ð)Ð)rN)r.r/r0r1rrÎr×r2rrròrò´sK€€€€€ð ð ð"ð"ð"ð ð ð ð *ð *ð *ð *ð *rròc ó|—eZdZdZdZdZdZdZdZdZ dZ d Z dZ dZ dZdZdZdZdZd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#eeee eeee e eeedœ Z$ide“de“de“de“de“d e“d!e “d"e“d#e“d$e“d%e“d&e“d'e“d(e“d)e “d*e“d+e“eeee e!e"e#d,œ¥Z%d-d.d/d0d1d2œZ&d3e'fe d4fd5„Z(d6„Z)d7„Z*d8„Z+d9„Z,d:„Z-d;Z.dÚ SysLogHandlera 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). rr>rJrtrurvrwrxéé é é é é éééééééééé) ÚalertÚcritÚcriticalÚdebugÚemergÚerrÚerrorÚinfoÚnoticeÚpanicÚwarnÚwarningÚauthÚauthprivÚconsoleÚcronÚdaemonÚftpÚkernÚlprÚmailÚnewsÚntpÚsecurityz solaris-cronÚsyslogÚuserÚuucpÚlocal0)Úlocal1Úlocal2Úlocal3Úlocal4Úlocal5Úlocal6Úlocal7rrrrr)ÚDEBUGÚINFOÚWARNINGÚERRORÚCRITICALÚ localhostNcó¤—tj |¦«||_||_||_d|_| ¦«dS)a Initialize a handler. If address is specified as a string, a UNIX socket is used. To log to a local syslogd, "SysLogHandler(address="/dev/log")" can be used. If facility is not specified, LOG_USER is used. If socktype is specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specific socket type will be used. For Unix sockets, you can also specify a socktype of None, in which case socket.SOCK_DGRAM will be used, falling back to socket.SOCK_STREAM. N)rr¹rr¼ÚfacilityÚsocktyperÇrÓ)rr¼r6r7s rrzSysLogHandler.__init__JsN€õ Œ× Ò  Ñ&Ô&Ð&àˆŒ Ø ˆŒ Ø ˆŒ ؈Œ Ø ×ÒÑÔÐÐÐrcó—|j}|€ tj}tjtj|¦«|_ |j |¦«||_dS#t $rŸ|j ¦«|j�‚tj}tjtj|¦«|_ |j |¦«||_YdS#t $r|j ¦«‚wxYwwxYwr¬)r7rÇrörÉrÌrÍrArÊ)rr¼Ú use_socktypes rÚ_connect_unixsocketz!SysLogHandler._connect_unixsocket_s€Ø”}ˆ Ø Ð Ý!Ô,ˆLÝ”m¥F¤N°LÑAÔAˆŒ ð Ø ŒK× Ò  Ñ (Ô (Ð (à(ˆDŒMˆMˆMøÝð ð ð Ø ŒK× Ò Ñ Ô Ð ØŒ}Ð(àÝ!Ô-ˆLÝ œ-­¬¸ ÑEÔEˆDŒKð Ø” ×#Ò# GÑ,Ô,Ð,à ,�” � � � øÝð ð ð Ø” ×!Ò!Ñ#Ô#Ð#Øð øøøð øøøs»!AÁADÂ:!CÃ%DÄDcóN—|j}|j}t|t¦«r0d|_ | |¦«dS#t $rYdSwxYwd|_|€ tj}|\}}tj ||d|¦«}|st d¦«‚|D]z}|\}}}} } dx} } tj|||¦«} |tj kr|   | ¦«n/#t $r"} | } | �|   ¦«Yd} ~ Œsd} ~ wwxYw| �| ‚| |_||_dS)af Try to create a socket and, if it's not a datagram socket, connect it to the other end. This method is called during handler initialization, but it's not regarded as an error if the other end isn't listening yet --- the method will be called again when emitting an event, if there is no socket at that point. TFNrz!getaddrinfo returns an empty list) r¼r7Ú isinstanceÚstrÚ unixsocketr:rÍrÇröÚ getaddrinforÊrÌrA)rr¼r7rºr»ÚressÚresÚafÚprotoÚ_Úsarr½Úexcs rrÓzSysLogHandler.createSocketwsz€ð”,ˆØ”=ˆå �g�sÑ #Ô #ð! %Ø"ˆDŒOð  Ø×(Ò(¨Ñ1Ô1Ð1Ð1Ð1øÝð ð ð Ø��ð øøøð$ˆDŒOØÐÝ!Ô,�Ø ‰JˆD�$ÝÔ% d¨D°!°XÑ>Ô>ˆDØð CÝÐAÑBÔBÐBØð %ð %�Ø-0Ñ*��H˜e Q¨Ø!Ð!��dð%Ý!œ=¨¨X°uÑ=Ô=�DØ¥6Ô#5Ò5Ð5ØŸ š  RÑ(Ô(Ð(Ø�EøÝð%ð%ð%Ø�CØÐ'ØŸ š ™ œ ˜ øøøøøøøøøð%øøøðˆØ� ؈DŒKØ$ˆDŒMˆMˆMs)¬AÁ AÁAÂ';C$Ã$ DÃ.D Ä Dcóš—t|t¦«r |j|}t|t¦«r |j|}|dz|zS)zé 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. rt)r<r=Úfacility_namesÚpriority_names)rr6Úprioritys rÚencodePriorityzSysLogHandler.encodePriority¥sQ€õ �h¥Ñ $Ô $ð 5ØÔ*¨8Ô4ˆHÝ �h¥Ñ $Ô $ð 5ØÔ*¨8Ô4ˆHؘA‘  Ñ)Ð)rcó—| ¦« |j}|rd|_| ¦«tj |¦«| ¦«dS#| ¦«wxYwrì)rírÇrArr¹rîrïs rrAzSysLogHandler.close²sr€ð � Š ‰Œˆð Ø”;ˆDØð Ø"�” Ø— ’ ‘ ” � Ý ŒO× !Ò ! $Ñ 'Ô 'Ð 'à �LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøørðcó8—|j |d¦«S)aK Map a logging level name to a key in the priority_names map. This is useful in two scenarios: when custom levels are being used, and in the case where you can't do a straightforward mapping by lowercasing the logging level name because of locale- specific issues (see SF #1524081). r)Ú priority_mapÚget)rÚ levelNames rÚ mapPriorityzSysLogHandler.mapPriorityÀs€ðÔ ×$Ò$ Y° Ñ:Ô:Ð:rÚTcó^— | |¦«}|jr |j|z}|jr|dz }d| |j| |j¦«¦«z}| d¦«}| d¦«}||z}|js|  ¦«|j r{ |j  |¦«dS#t$rQ|j  ¦«| |j¦«|j  |¦«YdSwxYw|jtjkr"|j ||j¦«dS|j |¦«dS#t($r| |¦«YdSwxYw)z± 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. úz<%d>úutf-8N)rLÚidentÚ append_nulrKr6rQÚ levelnameÚencoderÇrÓr>r×rÍrAr:r¼r7rörùrÕrr)rrrQÚprios rrzSysLogHandler.emitÍsÖ€ð %Ø—+’+˜fÑ%Ô%ˆCØŒzð 'Ø”j 3Ñ&�ØŒð Ø�v‘ �ð˜D×/Ò/°´ Ø04×0@Ò0@ÀÔAQÑ0RÔ0RñTôTñTˆDà—;’;˜wÑ'Ô'ˆDà—*’*˜WÑ%Ô%ˆCؘ‘*ˆCà”;ð $Ø×!Ò!Ñ#Ô#Ð#àŒð )ð*Ø”K×$Ò$ SÑ)Ô)Ð)Ð)Ð)øÝð*ð*ð*Ø”K×%Ò%Ñ'Ô'Ð'Ø×,Ò,¨T¬\Ñ:Ô:Ð:Ø”K×$Ò$ SÑ)Ô)Ð)Ð)Ð)Ð)ð*øøøð”¥&Ô"3Ò3Ð3Ø” ×"Ò" 3¨¬ Ñ5Ô5Ð5Ð5Ð5à” ×#Ò# CÑ(Ô(Ð(Ð(Ð(øÝð %ð %ð %Ø × Ò ˜VÑ $Ô $Ð $Ð $Ð $Ð $ð %øøøs7‚B9F Â<CÃAD3Ä/F Ä2D3Ä38F Å-F Æ F,Æ+F,)1r.r/r0r1Ú LOG_EMERGÚ LOG_ALERTÚLOG_CRITÚLOG_ERRÚ LOG_WARNINGÚ LOG_NOTICEÚLOG_INFOÚ LOG_DEBUGÚLOG_KERNÚLOG_USERÚLOG_MAILÚ LOG_DAEMONÚLOG_AUTHÚ LOG_SYSLOGÚLOG_LPRÚLOG_NEWSÚLOG_UUCPÚLOG_CRONÚ LOG_AUTHPRIVÚLOG_FTPÚLOG_NTPÚ LOG_SECURITYÚ LOG_CONSOLEÚ LOG_SOLCRONÚ LOG_LOCAL0Ú LOG_LOCAL1Ú LOG_LOCAL2Ú LOG_LOCAL3Ú LOG_LOCAL4Ú LOG_LOCAL5Ú LOG_LOCAL6Ú LOG_LOCAL7rIrHrNÚSYSLOG_UDP_PORTrr:rÓrKrArQrVrWrr2rrrûrûÞs’€€€€€ððð$€IØ€IØ€HØ€GØ€KØ€JØ€HØ€Ið€HØ€HØ€HØ€JØ€HØ€JØ€GØ€HØ€HØ€HØ€LØ€GØ€GØ€LØ€KØ€Kð€JØ€JØ€JØ€JØ€JØ€JØ€JØ€JðØØØØØØØØØØØð  ð  €Nð Ø˜ð à˜ ð ð ˜ ð ð ˜ð  ð ˜ ð  ð ˜ð  ð ˜ð ð ˜ð ð ˜ð ð ˜ð ð ˜ð ð ˜ ð ð ˜ ð ð ˜ ð ð ˜ð ð ˜ð! ð" ˜ ð# ð$#Ø"Ø"Ø"Ø"Ø"Ø"ð1 ð ð €Nð<ØØØØð ð€Lð!,¨_Ð=Ø"¨Tððððð*ððð0,%ð,%ð,%ð\ *ð *ð *ð ð ð ð;ð;ð;ð €EØ€Jð&%ð&%ð&%ð&%ð&%rrûcó(—eZdZdZ dd„Zd„Zd„ZdS)Ú SMTPHandlerzK A handler class which sends an SMTP email for each logging event. Nç@có–—tj |¦«t|tt f¦«r|\|_|_n|dc|_|_t|tt f¦«r|\|_|_ nd|_||_ t|t¦«r|g}||_ ||_ ||_||_dS)ax 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. To specify authentication credentials, supply a (username, password) tuple for the credentials argument. To specify the use of a secure protocol (TLS), pass in a tuple for the secure argument. This will only be used when authentication credentials are supplied. The tuple will be either an empty tuple, or a single-value tuple with the name of a keyfile, or a 2-value tuple with the names of the keyfile and certificate file. (This tuple is passed to the `starttls` method). A timeout in seconds can be specified for the SMTP connection (the default is one second). N)rr¹rr<ÚlistÚtupleÚmailhostÚmailportÚusernameÚpasswordÚfromaddrr=ÚtoaddrsÚsubjectÚsecurerÆ)rr‚r†r‡rˆÚ credentialsr‰rÆs rrzSMTPHandler.__init__ùs½€õ$ Œ× Ò  Ñ&Ô&Ð&Ý �h¥¥u  Ñ .Ô .ð :Ø+3Ñ (ˆDŒM˜4œ=˜=à+3°TÐ (ˆDŒM˜4œ=Ý �k¥D­% =Ñ 1Ô 1ð !Ø+6Ñ (ˆDŒM˜4œ=˜=à ˆDŒMØ ˆŒ Ý �g�sÑ #Ô #ð Ø�iˆG؈Œ ؈Œ ؈Œ ؈Œ ˆ ˆ rcó—|jS)zž Determine the subject for the email. If you want to specify a subject line which is record-dependent, override this method. )rˆrs rÚ getSubjectzSMTPHandler.getSubjects €ðŒ|Ðrcó — ddl}ddlm}ddl}|j}|s|j}| |j||j¬¦«}|¦«}|j |d<d  |j ¦«|d<|  |¦«|d<|j  ¦«|d <| | |¦«¦«|jr^|j�7| ¦«|j|jŽ| ¦«| |j|j¦«| |¦«| ¦«dS#t2$r| |¦«YdSwxYw) zd Emit a record. Format the record and send it to the specified addressees. rN)Ú EmailMessagerÅÚFromú,ÚToÚSubjectÚDate)ÚsmtplibÚ email.messagerŽÚ email.utilsrƒÚ SMTP_PORTÚSMTPr‚rÆr†r“r‡rŒÚutilsr{Ú set_contentrLr„r‰ÚehloÚstarttlsÚloginr…Ú send_messageÚquitrr)rrr”rŽÚemailr»ÚsmtprQs rrzSMTPHandler.emit%s‰€ð  %Ø ˆNˆNˆNØ 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø Ð Ð Ð à”=ˆDØð )ØÔ(�Ø—<’< ¤ ¨t¸T¼\�<ÑJÔJˆDØ�,‘.”.ˆCØœ-ˆC�‰KØŸš ¤Ñ.Ô.ˆC�‰IØ!Ÿ_š_¨VÑ4Ô4ˆC� ‰NØœ+×/Ò/Ñ1Ô1ˆC�‰KØ �OŠO˜DŸKšK¨Ñ/Ô/Ñ 0Ô 0Ð 0ØŒ}ð 9Ø”;Ð*Ø—I’I‘K”K�KØ!�D”M 4¤;Ð/Ð/Ø—I’I‘K”K�KØ— ’ ˜4œ=¨$¬-Ñ8Ô8Ð8Ø × Ò ˜cÑ "Ô "Ð "Ø �IŠI‰KŒKˆKˆKˆKøÝð %ð %ð %Ø × Ò ˜VÑ $Ô $Ð $Ð $Ð $Ð $ð %øøøs‚EEÅFÆF)NNr~)r.r/r0r1rrŒrr2rrr}r}õsV€€€€€ððð9<ð!ð!ð!ð!ðFððð%ð%ð%ð%ð%rr}có8—eZdZdZd d„Zd„Zd„Zd„Zd„Zd „Z dS) ÚNTEventLogHandleraý 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. NÚ Applicationc ó.—tj |¦« ddl}ddl}||_||_|sttj  |jj ¦«}tj  |d¦«}tj  |dd¦«}||_ ||_ |j |||¦«n-#t$r }t!|dd¦«dkr‚Yd}~nd}~wwxYw|j|_tj|jtj|jtj|jtj|jtj|ji|_dS#t6$rt9d¦«d|_YdSwxYw)Nrzwin32service.pydÚwinerrorrvzWThe Python Win32 extensions for NT (service, event logging) appear not to be available.)rr¹rÚwin32evtlogutilÚ win32evtlogÚappnameÚ_welur'r(r�Ú__file__r“ÚdllnameÚlogtypeÚAddSourceToRegistryrÚgetattrÚEVENTLOG_ERROR_TYPEÚdeftyper/ÚEVENTLOG_INFORMATION_TYPEr0r1ÚEVENTLOG_WARNING_TYPEr2r3ÚtypemapÚ ImportErrorÚprint)rr©r¬r­r§r¨Úes rrzNTEventLogHandler.__init__Os¡€ÝŒ× Ò  Ñ&Ô&Ð&ð Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø"ˆDŒLØ(ˆDŒJØð HÝœ'Ÿ-š-¨¬ Ô(;Ñ<Ô<�Ýœ'Ÿ-š-¨°¬ Ñ3Ô3�Ýœ'Ÿ,š, w¨q¤zÐ3FÑGÔG�Ø"ˆDŒLØ"ˆDŒLð Ø” ×.Ò.¨w¸ÀÑIÔIÐIÐIøÝð ð ð õ˜1˜j¨$Ñ/Ô/°1Ò4Ð4Øð5Ð4Ð4Ð4Ð4øøøøð øøøð 'Ô:ˆDŒLå”  +Ô"GÝ”  +Ô"GÝ” +Ô"CÝ”  +Ô"AÝÔ  +Ô"Að  ˆDŒLˆLˆLøõð ð ð Ý ð?ñ @ô @ð @àˆDŒJˆJˆJˆJð øøøs=¡BE0Â<CÃE0à DÃ#C>Ã9E0Ã>DÄA+E0Å0 FÆFcó—dS)ay 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. r>r2rs rÚ getMessageIDzNTEventLogHandler.getMessageIDrs €ðˆqrcó—dS)zž Return the event category for the record. Override this if you want to specify your own categories. This version returns 0. rr2rs rÚgetEventCategoryz"NTEventLogHandler.getEventCategory|s €ðˆqrcóL—|j |j|j¦«S)aå 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. )r´rOÚlevelnor±rs rÚ getEventTypezNTEventLogHandler.getEventType…s €ðŒ|×Ò ¤°´ Ñ=Ô=Ð=rcóV—|jr¡ | |¦«}| |¦«}| |¦«}| |¦«}|j |j||||g¦«dS#t$r| |¦«YdSwxYwdS)z” Emit a record. Determine the message ID, event category and event type. Then log the message in the NT event log. N) rªr¹r»r¾rLÚ ReportEventr©rr)rrÚidÚcatÚtyperQs rrzNTEventLogHandler.emit’sÇ€ð Œ:ð )ð )Ø×&Ò& vÑ.Ô.�Ø×+Ò+¨FÑ3Ô3�Ø×(Ò(¨Ñ0Ô0�Ø—k’k &Ñ)Ô)�Ø” ×&Ò& t¤|°R¸¸dÀSÀEÑJÔJÐJÐJÐJøÝð )ð )ð )Ø× Ò  Ñ(Ô(Ð(Ð(Ð(Ð(ð )øøøð )ð )s‰A8BÂB&Â%B&cóD—tj |¦«dS)aS 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)rr¹rA©rs rrAzNTEventLogHandler.close£s €õ Œ×Ò˜dÑ#Ô#Ð#Ð#Ð#r)Nr¤) r.r/r0r1rr¹r»r¾rrAr2rrr£r£Es~€€€€€ððð!ð!ð!ð!ðFðððððð >ð >ð >ð)ð)ð)ð" $ð $ð $ð $ð $rr£có0—eZdZdZ d d„Zd„Zd„Zd„ZdS) Ú HTTPHandlerz^ A class which sends records to a web server, using either GET or POST semantics. ÚGETFNcó —tj |¦«| ¦«}|dvrt d¦«‚|s|�t d¦«‚||_||_||_||_||_ ||_ dS)zr Initialize the instance with the host, the request URL, and the method ("GET" or "POST") )rÈÚPOSTzmethod must be GET or POSTNz3context parameter only makes sense with secure=True) rr¹rr`rgrºÚurlÚmethodr‰rŠÚcontext)rrºrËrÌr‰rŠrÍs rrzHTTPHandler.__init__µs”€õ Œ× Ò  Ñ&Ô&Ð&Ø—’‘”ˆØ ˜Ð (Ð (ÝÐ9Ñ:Ô:Ð :Øð 1˜'Ð-Ýð0ñ1ô1ð 1àˆŒ ؈ŒØˆŒ ؈Œ Ø&ˆÔ؈Œ ˆ ˆ rcó—|jS)z³ Default implementation of mapping the log record into a dict that is sent as the CGI data. Overwrite in your class. Contributed by Franz Glasner. )rÝrs rÚ mapLogRecordzHTTPHandler.mapLogRecordÉs €ð ŒÐrcóŠ—ddl}|r"|j ||j¬¦«}n|j |¦«}|S)z‹ get a HTTP[S]Connection. Override when a custom connection is required, for example if there is a proxy. rN)rÍ)Ú http.clientÚclientÚHTTPSConnectionrÍÚHTTPConnection)rrºr‰ÚhttpÚ connections rÚ getConnectionzHTTPHandler.getConnectionÑsQ€ð ÐÐÐØ ð :Øœ×4Ò4°TÀ4Ä<Ð4ÑPÔPˆJˆJàœ×3Ò3°DÑ9Ô9ˆJØÐrcó<— ddl}|j}| ||j¦«}|j}|j | |¦«¦«}|jdkr(|  d¦«dkrd}nd}|d||fzz}|  |j|¦«|  d¦«}|dkr |d|…}|jdkrF|  d d ¦«|  d tt|¦«¦«¦«|jrtddl} d |jz d ¦«} d|  | ¦« ¦« d¦«z} |  d| ¦«| ¦«|jdkr(| | d ¦«¦«| ¦«dS#t.$r| |¦«YdSwxYw)zk Emit a record. Send the record to the web server as a percent-encoded dictionary rNrÈú?ú&z%c%sú:rÊz Content-typez!application/x-www-form-urlencodedzContent-lengthz%s:%srUzBasic ÚasciiÚ Authorization)Ú urllib.parserºr×r‰rËÚparseÚ urlencoderÏrÌÚfindÚ putrequestÚ putheaderr=rOrŠÚbase64rYÚ b64encodeÚstripÚdecodeÚ endheadersr×Ú getresponserr) rrÚurllibrºrTrËÚdataÚseprFrär¤s rrzHTTPHandler.emitßs€ð # %Ø Ð Ð Ð Ø”9ˆDØ×"Ò" 4¨¬Ñ5Ô5ˆAØ”(ˆCØ”<×)Ò)¨$×*;Ò*;¸FÑ*CÔ*CÑDÔDˆDØŒ{˜eÒ#Ð#Ø—H’H˜S‘M”M QÒ&Ð&Ø�C�Cà�CؘF c¨4 [Ñ0Ñ0�Ø �LŠL˜œ cÑ *Ô *Ð *ð— ’ ˜#‘”ˆAØ�AŠvˆvؘB˜Q˜B”x�ðŒ{˜fÒ$Ð$Ø— ’ ˜NØ?ñAôAðAà— ’ Ð,­cµ#°d±)´)©n¬nÑ=Ô=Ð=ØÔð 0Ø� � � ؘtÔ/Ñ/×7Ò7¸Ñ@Ô@�ؘv×/Ò/°Ñ2Ô2×8Ò8Ñ:Ô:×AÒAÀ'ÑJÔJÑJ�Ø— ’ ˜O¨QÑ/Ô/Ð/Ø �LŠL‰NŒNˆNØŒ{˜fÒ$Ð$Ø—’�t—{’{ 7Ñ+Ô+Ñ,Ô,Ð,Ø �MŠM‰OŒOˆOˆOˆOøÝð %ð %ð %Ø × Ò ˜VÑ $Ô $Ð $Ð $Ð $Ð $ð %øøøs‚G4G8Ç8HÈH)rÈFNN)r.r/r0r1rrÏr×rr2rrrÇrǰsi€€€€€ðððKOØððððð(ððð ð ð ð)%ð)%ð)%ð)%ð)%rrÇcó0—eZdZdZd„Zd„Zd„Zd„Zd„ZdS)ÚBufferingHandlerzå 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ó`—tj |¦«||_g|_dS)z> Initialize the handler with the buffer size. N)rr¹rÚcapacityÚbuffer)rrðs rrzBufferingHandler.__init__s,€õ Œ× Ò  Ñ&Ô&Ð&Ø ˆŒ ؈Œ ˆ ˆ rcó<—t|j¦«|jkS)z¼ 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. )rOrñrðrs rÚ shouldFlushzBufferingHandler.shouldFlushs€õ�D”KÑ Ô  D¤MÒ1Ð2rcó�—|j |¦«| |¦«r| ¦«dSdS)z† Emit a record. Append the record. If shouldFlush() tells us to, call flush() to process the buffer. N)rñr’rór³rs rrzBufferingHandler.emit!sK€ð Œ ×Ò˜6Ñ"Ô"Ð"Ø × Ò ˜FÑ #Ô #ð Ø �JŠJ‰LŒLˆLˆLˆLð ð rcó¼—| ¦« |j ¦«| ¦«dS#| ¦«wxYw)zw Override to implement custom flushing behaviour. This version just zaps the buffer to empty. N)rírñÚclearrîrÅs rr³zBufferingHandler.flush,sM€ð � Š ‰Œˆð Ø ŒK× Ò Ñ Ô Ð à �LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøøs –AÁAcó¶— | ¦«tj |¦«dS#tj |¦«wxYw)zp Close the handler. This version just flushes and chains to the parent class' close(). N)r³rr¹rArÅs rrAzBufferingHandler.close8sL€ð  (Ø �JŠJ‰LŒLˆLå ŒO× !Ò ! $Ñ 'Ô 'Ð 'Ð 'Ð 'ø�GŒO× !Ò ! $Ñ 'Ô 'Ð 'Ð 'øøøs ‚7·!AN) r.r/r0r1rrórr³rAr2rrrîrî si€€€€€ððð ððð3ð3ð3ð ð ð ð ð ð ð (ð (ð (ð (ð (rrîcóB—eZdZdZejddfd„Zd„Zd„Zd„Z d„Z dS) Ú MemoryHandlerzâ 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. NTcóf—t ||¦«||_||_||_dS)a; 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! The ``flushOnClose`` argument is ``True`` for backward compatibility reasons - the old behaviour is that when the handler is closed, the buffer is flushed, even if the flush level hasn't been exceeded nor the capacity exceeded. To prevent this, set ``flushOnClose`` to ``False``. N)rîrÚ flushLevelÚtargetÚ flushOnClose)rrðrûrürýs rrzMemoryHandler.__init__Is6€õ ×!Ò! $¨Ñ1Ô1Ð1Ø$ˆŒØˆŒ à(ˆÔÐÐrcó\—t|j¦«|jkp|j|jkS)zP Check for buffer full or a record at the flushLevel or higher. )rOrñrðr½rûrs rrózMemoryHandler.shouldFlush]s.€õ�D”KÑ Ô  D¤MÒ1ð4Ø” 4¤?Ò2ð 4rcó˜—| ¦« ||_| ¦«dS#| ¦«wxYw)z: Set the target handler for this handler. N)rírürî)rrüs rÚ setTargetzMemoryHandler.setTargetds@€ð � Š ‰Œˆð Ø ˆDŒKà �LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøøs –3³A có—| ¦« |jr=|jD]}|j |¦«Œ|j ¦«| ¦«dS#| ¦«wxYw)zö For a MemoryHandler, flushing means just sending the buffered records to the target, if there is one. Override if you want different behaviour. The record buffer is only cleared if a target has been set. N)rírürñÚhandlerörîrs rr³zMemoryHandler.flushns�€ð � Š ‰Œˆð ØŒ{ð $Ø"œkð/ð/�FØ”K×&Ò& vÑ.Ô.Ð.Ð.Ø” ×!Ò!Ñ#Ô#Ð#à �LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøøs –AA0Á0BcóÔ— |jr| ¦«| ¦« d|_t |¦«| ¦«dS#| ¦«wxYw#| ¦« d|_t |¦«| ¦«w#| ¦«wxYwxYw)zi Flush, if appropriately configured, set the target to None and lose the buffer. N)rýr³rírürîrArîrÅs rrAzMemoryHandler.closesÀð ØÔ ð Ø— ’ ‘ ” � à �LŠL‰NŒNˆNð Ø"�” Ý ×&Ò& tÑ,Ô,Ð,à— ’ ‘”���ø�— ’ ‘”��øøøøð �LŠL‰NŒNˆNð Ø"�” Ý ×&Ò& tÑ,Ô,Ð,à— ’ ‘”��ø�— ’ ‘”��øøøøøøs.‚B²!A)Á)A?ÂC'Â!CÂ9C'ÃC$Ã$C') r.r/r0r1rr2rrórr³rAr2rrrùrùCsz€€€€€ððð -4¬MÀ$Ø"ð)ð)ð)ð)ð(4ð4ð4ððððððð"ððððrrùcó*—eZdZdZd„Zd„Zd„Zd„ZdS)Ú QueueHandlera„ This handler sends events to a queue. Typically, it would be used together with a multiprocessing Queue to centralise logging to file in one process (in a multi-process application), so as to avoid file write contention between processes. This code is new in Python 3.2, but this class can be copy pasted into user code for use with earlier Python versions. cóR—tj |¦«||_dS)zA Initialise an instance, using the passed queue. N)rr¹rÚqueue)rrs rrzQueueHandler.__init__›s%€õ Œ× Ò  Ñ&Ô&Ð&؈Œ ˆ ˆ rcó:—|j |¦«dS)zÑ Enqueue a record. The base implementation uses put_nowait. You may want to override this method if you want to use blocking, timeouts or custom queue implementations. N)rÚ put_nowaitrs rÚenqueuezQueueHandler.enqueue¢s €ð Œ ×Ò˜fÑ%Ô%Ð%Ð%Ð%rcó¬—| |¦«}tj|¦«}||_||_d|_d|_d|_d|_|S)a½ Prepare a record for queuing. The object returned by this method is enqueued. The base implementation formats the record to merge the message and arguments, and removes unpickleable items from the record in-place. Specifically, it overwrites the record's `msg` and `message` attributes with the merged message (obtained by calling the handler's `format` method), and sets the `args`, `exc_info` and `exc_text` attributes to None. You might want to override this method if you want to convert the record to a dict or JSON string, or send a modified copy of the record while leaving the original intact. N)rLÚcopyrÛrQrÙrÚÚexc_textÚ stack_inforPs rÚpreparezQueueHandler.prepare¬sT€ð,�kŠk˜&Ñ!Ô!ˆå”˜6Ñ"Ô"ˆØˆŒØˆŒ ؈Œ ؈ŒØˆŒØ ˆÔ؈ rcó¤— | | |¦«¦«dS#t$r| |¦«YdSwxYw)zm Emit a record. Writes the LogRecord to the queue, preparing it for pickling first. N)r rrrrs rrzQueueHandler.emitÍsc€ð  %Ø �LŠL˜Ÿš fÑ-Ô-Ñ .Ô .Ð .Ð .Ð .øÝð %ð %ð %Ø × Ò ˜VÑ $Ô $Ð $Ð $Ð $Ð $ð %øøøs‚(,¬AÁAN)r.r/r0r1rr rrr2rrrr�s[€€€€€ðððððð&ð&ð&ððððB %ð %ð %ð %ð %rrcóL—eZdZdZdZddœd„Zd„Zd„Zd„Zd „Z d „Z d „Z d „Z dS) Ú QueueListenerz½ This class implements an internal threaded listener which watches for LogRecords being added to a queue, removes them and passes them to a list of handlers for processing. NF)Úrespect_handler_levelcó>—||_||_d|_||_dS)zW Initialise an instance with the specified queue and handlers. N)rÚhandlersÚ_threadr)rrrrs rrzQueueListener.__init__ás'€ð ˆŒ Ø ˆŒ ؈Œ Ø%:ˆÔ"Ð"Ð"rcó6—|j |¦«S)zå Dequeue a record and return it, optionally blocking. The base implementation uses get. You may want to override this method if you want to use timeouts or work with custom queue implementations. )rrO)rÚblocks rÚdequeuezQueueListener.dequeueës€ðŒz�~Š~˜eÑ$Ô$Ð$rcó~—tj|j¬¦«x|_}d|_| ¦«dS)z‰ Start the listener. This starts up a background thread to monitor the queue for LogRecords to process. )rüTN)Ú threadingÚThreadÚ_monitorrrr–)rrrs rr–zQueueListener.startôs8€õ%Ô+°4´=ÐAÑAÔAÐAˆŒ �q؈ŒØ �Љ Œ ˆ ˆ ˆ rcó—|S)a Prepare a record for handling. This method just returns the passed-in record. You may want to override this method if you need to do any custom marshalling or manipulation of the record before passing it to the handlers. r2rs rrzQueueListener.prepareÿs €ðˆ rcó¦—| |¦«}|jD]3}|jsd}n|j|jk}|r| |¦«Œ4dS)z| Handle a record. This just loops through the handlers offering them the record to handle. TN)rrrr½Úlevelr)rrÚhandlerÚprocesss rrzQueueListener.handle sk€ð—’˜fÑ%Ô%ˆØ”}ð 'ð 'ˆGØÔ-ð :Ø��à œ.¨G¬MÒ9�Øð 'Ø—’˜vÑ&Ô&Ð&øð  'ð 'rcó&—|j}t|d¦«} | d¦«}||jur|r| ¦«dS| |¦«|r| ¦«n#tj$rYdSwxYwŒz)zæ Monitor the queue for records, and ask the handler to deal with them. This method runs on a separate, internal thread. The thread will terminate if it sees a sentinel object in the queue. Ú task_doneTN)rÚhasattrrÚ _sentinelr$rÚEmpty)rÚqÚ has_task_doners rrzQueueListener._monitors­€ð ŒJˆÝ  ;Ñ/Ô/ˆ ð ð ØŸš dÑ+Ô+�ؘTœ^Ð+Ð+Ø$ð&ØŸ š ™ œ ˜ Ø�EØ— ’ ˜FÑ#Ô#Ð#Ø ð"Ø—K’K‘M”M�MøøÝ”;ð ð ð Ø��ð øøøð sš4A<Á+A<Á<BÂBcóD—|j |j¦«dS)zì This is used to enqueue the sentinel record. The base implementation uses put_nowait. You may want to override this method if you want to use timeouts or work with custom queue implementations. N)rr r&rÅs rÚenqueue_sentinelzQueueListener.enqueue_sentinel0s"€ð Œ ×Ò˜dœnÑ-Ô-Ð-Ð-Ð-rcón—| ¦«|j ¦«d|_dS)a  Stop the listener. This asks the thread to terminate, and then waits for it to do so. Note that if you don't call this before your application exits, there may be some records still left on the queue, which won't be processed. N)r+rr“rÅs rÚstopzQueueListener.stop:s5€ð ×ÒÑÔÐØ Œ ×ÒÑÔÐØˆŒ ˆ ˆ r) r.r/r0r1r&rrr–rrrr+r-r2rrrrÙsª€€€€€ððð €Ià?Dð;ð;ð;ð;ð;ð%ð%ð%ð ð ð ðððð'ð'ð'ð ððð..ð.ð.ð ð ð ð ð rr)(r1r9rrÇr'ràrârorjrnrrrrrr ÚDEFAULT_TCP_LOGGING_PORTÚDEFAULT_UDP_LOGGING_PORTÚDEFAULT_HTTP_LOGGING_PORTÚDEFAULT_SOAP_LOGGING_PORTr{ÚSYSLOG_TCP_PORTr|rrr4rSr¦r¹r·ròrûr}r£rÇrîrùrÚobjectrr2rrúr4s²ðð"ðð9Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ø)Ð)Ð)Ð)Ð)Ð)Ð)Ð)Ð)Ð)Ø € € € ØÐÐÐØ € € € ð #ÐØ"ÐØ"ÐØ"ÐØ!€Ø!€à € ðH'ðH'ðH'ðH'ðH'˜'Ô-ñH'ôH'ðH'ðTQðQðQðQðQÐ-ñQôQðQðfw<ðw<ðw<ðw<ðw<Ð2ñw<ôw<ðw<ðrG/ðG/ðG/ðG/ðG/˜Ô,ñG/ôG/ðG/ðTeðeðeðeðe�G”OñeôeðeðN(*ð(*ð(*ð(*ð(*�mñ(*ô(*ð(*ðTU%ðU%ðU%ðU%ðU%�G”OñU%ôU%ðU%ðnN%ðN%ðN%ðN%ðN%�'”/ñN%ôN%ðN%ð`i$ði$ði$ði$ði$˜œñi$ôi$ði$ðVX%ðX%ðX%ðX%ðX%�'”/ñX%ôX%ðX%ðt7(ð7(ð7(ð7(ð7(�w”ñ7(ô7(ð7(ðrJðJðJðJðJÐ$ñJôJðJðZF%ðF%ðF%ðF%ðF%�7”?ñF%ôF%ðF%ðRkðkðkðkðk�Fñkôkðkðkðkr