0x1949 Team - FAZEMRX - MANAGER
Edit File: _observer.cpython-310.pyc
o �b� � @ s� d Z ddlmZmZ ddlmZ ddlmZ ddlm Z m Z ddlmZ dZ ee �G d d � d ��Zee �de dd fdd��Zd S )z Basic log observers. � )�Callable�Optional)�implementer)�Failure� )�ILogObserver�LogEvent)�LoggerzITemporarily disabling observer {observer} due to exception: {log_failure}c @ sj e Zd ZdZdeddfdd�Zdeddfdd �Zdeddfd d�Zdeddfd d�Z dede fdd�ZdS )�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 G s t |�| _t| d�| _d S )N��observer)�list� _observersr �log)�selfr � r �:/usr/lib/python3/dist-packages/twisted/logger/_observer.py�__init__ s zLogPublisher.__init__r c C s4 t |�std|����|| jvr| j�|� dS dS )zq Registers an observer with this publisher. @param observer: An L{ILogObserver} to add. zObserver is not callable: N)�callable� TypeErrorr �append�r r r r r �addObserver# s �zLogPublisher.addObserverc C s( z | j �|� W dS ty Y dS w )zv Unregisters an observer with this publisher. @param observer: An L{ILogObserver} to remove. N)r �remove� ValueErrorr r r r �removeObserver. s �zLogPublisher.removeObserver�eventc s� d� vrd}ndt ddf� �fdd�}g }�jD ]!}|dur"||� z|� � W q ty9 |�|t� f� Y qw |D ]\}}��|�}|jt||d� q<dS )z8 Forward events to contained observers. � log_traceNr r c s � d � �| f� dS )z� Add tracing information for an observer. @param observer: an observer being forwarded to r N)r r �r r r r �traceB s z$LogPublisher.__call__.<locals>.trace)�failurer )r r � Exceptionr r �_errorLoggerForObserverr"