+
    üÐjy  ã                   ó¼   € R t ^ RIHtHtHtHtHt ^ RIHt ^RI	H
t
 ^RIHtHt ^RIHt ^RIHtHt ]'       d   ^ RIHt ]! ]4       ! R R	4      4       tR
 R ltR# )z)
Integration with L{twisted.python.log}.
)ÚTYPE_CHECKINGÚAnyÚCallableÚDictÚOptional)Úimplementer)ÚformatEvent)ÚILogObserverÚLogEvent)ÚLogLevel)ÚStringifiableFromEventÚfromStdlibLogLevelMapping)r	   c                   óZ   a € ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltRtV t	R	# )
ÚLegacyLogObserverWrapperzÙ
L{ILogObserver} that wraps a L{twisted.python.log.ILogObserver}.

Received (new-style) events are modified prior to forwarding to
the legacy observer to ensure compatibility with observers that
expect legacy events.
c                ó"   <€ V ^8„  d   QhRRRR/# )é   ÚlegacyObserverÚILegacyLogObserverÚreturnN© )ÚformatÚ__classdict__s   "€Ú8/usr/lib/python3/dist-packages/twisted/logger/_legacy.pyÚ__annotate__Ú%LegacyLogObserverWrapper.__annotate__    s   ø€ ÷ -ñ -Ð';ð -Àñ -ó    c                ó   € Wn         R# )zZ
@param legacyObserver: a legacy observer to which this observer will
    forward events.
N©r   )Úselfr   s   &&r   Ú__init__Ú!LegacyLogObserverWrapper.__init__    s
   € ð
 -Ör   c                ó    <€ V ^8„  d   QhRS[ /# )r   r   )Ústr)r   r   s   "€r   r   r   '   s   ø€ ÷ Tñ T™#ñ Tr   c                ó&   € R P                  V R7      # )z0{self.__class__.__name__}({self.legacyObserver})©r   )r   r$   s   &r   Ú__repr__Ú!LegacyLogObserverWrapper.__repr__'   s   € ØA×HÑHÈdÐHÓSÐSr   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úeventr   N)r
   )r   r   s   "€r   r   r   *   s   ø€ ÷ 0#ñ 0#™hð 0#¨4ñ 0#r   c                óN  € RV9  d   RVR&   RV9  d   VR,          VR&   RV9  d   VP                  RR4      VR&   RV9  dX   VP                  RR	4      eD   R
VR&   \        VP                  4       4      VR&   \        VR,          \        4      '       g   RVR&   RV9   d6   RV9  d   VR,          VR&   RV9  d   ^VR&   RV9  d   \        V4      VR&   M>RV9  d8   VR,          \        P                  \        P                  39   d   ^VR&   M^ VR&   V P                  V4       R	# )zk
Forward events to the legacy observer after editing them to
ensure compatibility.

@param event: an event
ÚmessageÚtimeÚlog_timeÚsystemÚ
log_systemÚ-r   Ú
log_formatNz%(log_legacy)sÚ
log_legacyÚlog_failureÚfailureÚisErrorÚwhyÚ	log_levelr   )
Úgetr   ÚcopyÚ
isinstanceÚtupler   r   ÚerrorÚcriticalr   )r   r(   s   &&r   Ú__call__Ú!LegacyLogObserverWrapper.__call__*   s0  € ð ˜EÔ!Ø!ˆE�)Ñà˜ÔØ! *Õ-ˆE�&‰Mà˜5Ô Ø#Ÿi™i¨°cÓ:ˆE�(‰Oð ˜5Ô  U§Y¡Y¨|¸TÓ%BÒ%Nð /ˆE�(‰OÜ"8¸¿¹»Ó"FˆE�,Ñô ˜e IÕ.´×6Ò6Ø#%��iÑ ð ˜EÔ!Ø Ô%Ø#(¨Õ#7��iÑ Ø Ô%Ø#$��iÑ Ø˜EÔ!Ü*¨5Ó1��e‘øØ˜eÔ#Ø�[Õ!¤h§n¡n´h×6GÑ6GÐ%HÔHØ#$��iÒ à#$��iÑ à×Ñ˜EÖ"r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r%   r=   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s*   ø‡ € ñ÷-ð -÷Tð T÷0#ö 0#r   r   c          	      ó¾   € V ^8„  d   QhR\         R\        \        \        3,          R\        \        \        \        3,          .\
        \        ,          3,          RR/# )r   ÚobserverÚ	eventDictÚtextFromEventDictr   N)r	   r   r"   r   r   r   )r   s   "r   r   r   ]   sQ   € ÷ 6ñ 6Üð6ä”Cœ�H�~ð6ô  ¤¤c¬3 h¥Ð 0´(¼3µ-Ð ?Õ@ð6ð 
ñ	6r   c                óÎ  € RV9  d   VR,          VR&   RV9  d   V! V4      pVe
   W1R&   RVR&   RV9  dn   RV9   d    \         VR,          ,          pMHR	V9   d2   VR	,          '       d   \        P                  pM!\        P                  pM\        P                  pVe   WAR&   R
V9  d   RVR
&   RV9  d   RV9   d   VR,          VR&   V ! V4       R#   \         d    Rp LGi ; i)aî  
Publish an old-style (L{twisted.python.log}) event to a new-style
(L{twisted.logger}) observer.

@note: It's possible that a new-style event was sent to a
    L{LegacyLogObserverWrapper}, and may now be getting sent back to a
    new-style observer.  In this case, it's already a new-style event,
    adapted to also look like an old-style event, and we don't need to
    tweak it again to be a new-style event, hence this checks for
    already-defined new-style keys.

@param observer: A new-style observer to handle this event.
@param eventDict: An L{old-style <twisted.python.log>}, log event.
@param textFromEventDict: callable that can format an old-style event as a
    string.  Passed here rather than imported to avoid circular dependency.
r,   r+   r0   NÚlog_textz
{log_text}r6   ÚlogLevelr4   Úlog_namespacer1   r.   r-   )r   ÚKeyErrorr   r<   Úinfo)rG   rH   rI   ÚtextÚlevels   &&&  r   ÚpublishToNewObserverrR   ]   s÷   € ð, ˜Ô"Ø )¨&Õ 1ˆ	�*Ñà˜9Ô$Ù  Ó+ˆØÒØ$(�jÑ!Ø&2ˆI�lÑ#à˜)Ô#Ø˜Ô"ðÜ1°)¸JÕ2GÕH‘ð ˜)Ô#Ø˜×#Ô#Ü ×)Ñ)‘ä Ÿ™‘ä—M‘MˆEàÒØ%*�kÑ"à˜iÔ'Ø%1ˆ	�/Ñ"à˜9Ô$¨°YÔ)>Ø"+¨HÕ"5ˆ	�,ÑáˆYÖøô' ô Ø’ðús   ¿C ÃC$Ã#C$N)rC   Útypingr   r   r   r   r   Úzope.interfacer   Ú_formatr   Ú_interfacesr	   r
   Ú_levelsr   Ú_stdlibr   r   Útwisted.python.logr   r   rR   r   r   r   Ú<module>rZ      sO   ðñ
÷ @Õ ?å &å  ß /Ý ß FçÝEñ ˆ\Ó÷C#ð C#ó ðC#÷L6r   