%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/logger/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/logger/__pycache__/_observer.cpython-312.pyc

�

Ϫ�f����dZddlmZmZddlmZddlmZddlm	Z	m
Z
ddlmZdZ
ee	�Gd	�d
��Zee	�de
dd
fd��Zy
)z
Basic log observers.
�)�Callable�Optional)�implementer)�Failure�)�ILogObserver�LogEvent)�LoggerzITemporarily disabling observer {observer} due to exception: {log_failure}c�`�eZdZdZdeddfd�Zdeddfd�Zdeddfd�Zd	eddfd
�Z	dede
fd�Zy)�LogPublisherz�
    I{ILogObserver} that fans out events to other observers.

    Keeps track of a set of L{ILogObserver} objects and forwards
    events to each.
    �	observers�returnNc�F�t|�|_t|��|_y)N��observer)�list�
_observersr
�log)�selfr
s  �:/usr/lib/python3/dist-packages/twisted/logger/_observer.py�__init__zLogPublisher.__init__s���y�/����4�(���rc��t|�std|����||jvr|jj|�yy)zq
        Registers an observer with this publisher.

        @param observer: An L{ILogObserver} to add.
        zObserver is not callable: N)�callable�	TypeErrorr�append�rrs  r�addObserverzLogPublisher.addObserver#sB����!��8���E�F�F��4�?�?�*��O�O�"�"�8�,�+rc�Z�	|jj|�y#t$rYywxYw)zv
        Unregisters an observer with this publisher.

        @param observer: An L{ILogObserver} to remove.
        N)r�remove�
ValueErrorrs  r�removeObserverzLogPublisher.removeObserver.s+��	��O�O�"�"�8�,���	��	�s��	*�*�eventc�:���d�vrd}ndtddf��fd�}g}�jD]}|�||�	|���|D].\}}�j|�}|j
t||���0y#t$r|j|t	�f�Y�rwxYw)z8
        Forward events to contained observers.
        �	log_traceNrrc�2���dj�|f�y)z�
                Add tracing information for an observer.

                @param observer: an observer being forwarded to
                r%N)r)rr#rs ��r�tracez$LogPublisher.__call__.<locals>.traceBs����k�"�)�)�4��*:�;r)�failurer)rr�	Exceptionrr�_errorLoggerForObserverr(�OBSERVER_DISABLED)rr#r'�brokenObserversr�brokenObserverr(�errorLoggers``      r�__call__zLogPublisher.__call__9s�����e�#�>B�E�
<��
<��
<������	>�H�� ��h��
>����	>�(7�	�#�N�G��6�6�~�F�K����!��'�
 �
�	���
>��&�&��'�)�'<�=�
>�s�A3�3$B�Bc�R��t�fd�|jD��}t|��S)z�
        Create an error-logger based on this logger, which does not contain the
        given bad observer.

        @param observer: The observer which previously had an error.

        @return: A L{Logger} without the given observer.
        c3�,�K�|]}|�us�|���
y�w)N�)�.0�obsrs  �r�	<genexpr>z7LogPublisher._errorLoggerForObserver.<locals>.<genexpr>gs�����
D�c��8�0C�c�
D�s�	�r)rrr
)rr�errorPublishers ` rr*z$LogPublisher._errorLoggerForObserver]s(���&�
D�T�_�_�
D�
���~�.�.r)�__name__�
__module__�__qualname__�__doc__rrrr"r	r/r
r*r2rrrrsg���)�<�)�D�)�	-�L�	-�T�	-�	�|�	��	�"�h�"�4�"�H/��/��/rrr#rNc��y)zD
    I{ILogObserver} that does nothing with the events it sees.
    Nr2)r#s r�bitbucketLogObserverr<ls�r)r:�typingrr�zope.interfacer�twisted.python.failurer�_interfacesrr	�_loggerr
r+rr<r2rr�<module>rBso��
�&�&�*�/��P��

�\��R/�R/��R/�j
�\�����T���r

Zerion Mini Shell 1.0