OwlCyberSecurity - MANAGER
Edit File: _observer.pyc
� `��ac @ s~ d Z d d l m Z m Z d d l m Z d d l m Z d Z d e f d � � YZ e e � d e f d � � Y� Z d S( s Basic log observers. i����( t Interfacet implementer( t Failurei ( t LoggersI Temporarily disabling observer {observer} due to exception: {log_failure}t ILogObserverc B s e Z d Z d � Z RS( s An observer which can handle log events. Unlike most interfaces within Twisted, an L{ILogObserver} I{must be thread-safe}. Log observers may be called indiscriminately from many different threads, as any thread may wish to log a message at any time. c C s d S( s� Log an event. @type event: C{dict} with (native) C{str} keys. @param event: A dictionary with arbitrary keys as defined by the application emitting logging events, as well as keys added by the logging system. The logging system reserves the right to set any key beginning with the prefix C{"log_"}; applications should not use any key so named. Currently, the following keys are used by the logging system in some way, if they are present (they are all optional): - C{"log_format"}: a PEP-3101-style format string which draws upon the keys in the event as its values, used to format the event for human consumption. - C{"log_flattened"}: a dictionary mapping keys derived from the names and format values used in the C{"log_format"} string to their values. This is used to preserve some structured information for use with L{twisted.logger.extractField}. - C{"log_trace"}: A L{list} designed to capture information about which L{LogPublisher}s have observed the event. - C{"log_level"}: a L{log level <twisted.logger.LogLevel>} constant, indicating the importance of and audience for this event. - C{"log_namespace"}: a namespace for the emitter of the event, given as a unicode string. - C{"log_system"}: a string indicating the network event or method call which resulted in the message being logged. N( ( t event( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/logger/_observer.pyt __call__ t ( t __name__t __module__t __doc__R ( ( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/logger/_observer.pyR s t LogPublisherc B s; e Z d Z d � Z d � Z d � Z d � Z d � Z RS( s� I{ILogObserver} that fans out events to other observers. Keeps track of a set of L{ILogObserver} objects and forwards events to each. c G s% t | � | _ t d | � | _ d S( Nt observer( t listt _observersR t log( t selft observers( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/logger/_observer.pyt __init__O s c C sJ t | � s$ t d j | � � � n | | j k rF | j j | � n d S( sq Registers an observer with this publisher. @param observer: An L{ILogObserver} to add. s Observer is not callable: {0!r}N( t callablet TypeErrort formatR t append( R R ( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/logger/_observer.pyt addObserverT s c C s, y | j j | � Wn t k r'