§
    ÈtºfD  ã                   óh   — d Z  ed¦  «        ZddlmZ dZej        Z G d„ d¦  «        Zdeedfd„Z	d	S )
zo
Classes and utility functions for integrating Twisted and syslog.

You probably want to call L{startLogging}.
Úsyslogé    )Úlogc                   ó@   — e Zd ZdZej        Zej        Zeefd„Zd„ Z	dS )ÚSyslogObserveraU  
    A log observer for logging to syslog.

    See L{twisted.python.log} for context.

    This logObserver will automatically use LOG_ALERT priority for logged
    failures (such as from C{log.err()}), but you can use any priority and
    facility by setting the 'C{syslogPriority}' and 'C{syslogFacility}' keys in
    the event dict.
    c                 ó4   — |                       |||¦  «         dS )aß  
        @type prefix: C{str}
        @param prefix: The syslog prefix to use.

        @type options: C{int}
        @param options: A bitvector represented as an integer of the syslog
            options to use.

        @type facility: C{int}
        @param facility: An indication to the syslog daemon of what sort of
            program this is (essentially, an additional arbitrary metadata
            classification for messages sent to syslog by this observer).
        N)Úopenlog)ÚselfÚprefixÚoptionsÚfacilitys       úT/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/python/syslog.pyÚ__init__zSyslogObserver.__init__#   s    € ð 	�Š�V˜W hÑ/Ô/Ð/Ð/Ð/ó    c                 óô  — t          j        |¦  «        }|€dS t          j        }d}|d         rt          j        }d|v rt          |d         ¦  «        }d|v rt          |d         ¦  «        }|                     d¦  «        }|dd…         dgk    r#|                     ¦   «          |dd…         dgk    °#d	}|D ]?}|rd
}nd|z   }|                      ||z  d                     |d         |¦  «        ¦  «         Œ@dS )a†  
        Send a message event to the I{syslog}.

        @param eventDict: The event to send.  If it has no C{'message'} key, it
            will be ignored.  Otherwise, if it has C{'syslogPriority'} and/or
            C{'syslogFacility'} keys, these will be used as the syslog priority
            and facility.  If it has no C{'syslogPriority'} key but a true
            value for the C{'isError'} key, the B{LOG_ALERT} priority will be
            used; if it has a false value for C{'isError'}, B{LOG_INFO} will be
            used.  If the C{'message'} key is multiline, each line will be sent
            to the syslog separately.
        Nr   ÚisErrorÚsyslogPriorityÚsyslogFacilityú
éÿÿÿÿÚ TFú	z[{}] {}Úsystem)	r   ÚtextFromEventDictr   ÚLOG_INFOÚ	LOG_ALERTÚintÚsplitÚpopÚformat)r	   Ú	eventDictÚtextÚpriorityr   ÚlinesÚ	firstLineÚlines           r   ÚemitzSyslogObserver.emit3   s;  € õ Ô$ YÑ/Ô/ˆØˆ<ØˆFõ ”?ˆØˆØ�YÔð 	(ÝÔ'ˆHØ˜yÐ(Ð(Ý˜9Ð%5Ô6Ñ7Ô7ˆHØ˜yÐ(Ð(Ý˜9Ð%5Ô6Ñ7Ô7ˆHð —
’
˜4Ñ Ô ˆØ�B�C�CŒj˜R˜DÒ Ð Ø�IŠI‰KŒKˆKð �B�C�CŒj˜R˜DÒ Ð ð ˆ	Øð 	ð 	ˆDØð #Ø!�	�	à˜d‘{�Ø�KŠKØ˜8Ñ# Y×%5Ò%5°iÀÔ6IÈ4Ñ%PÔ%Pñô ð ð ð	ð 	r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚDEFAULT_OPTIONSÚDEFAULT_FACILITYr   r&   © r   r   r   r      sW   € € € € € ð	ð 	ð Œn€GØŒ]€Fà'6ÐAQð 0ð 0ð 0ð 0ð )ð )ð )ð )ð )r   r   ÚTwistedé   c                 ó^   — t          | ||¦  «        }t          j        |j        |¬¦  «         dS )a  
    Send all Twisted logging output to syslog from now on.

    The prefix, options and facility arguments are passed to
    C{syslog.openlog()}, see the Python syslog documentation for details. For
    other parameters, see L{twisted.python.log.startLoggingWithObserver}.
    )Ú	setStdoutN)r   r   ÚstartLoggingWithObserverr&   )r
   r   r   r1   Úobss        r   ÚstartLoggingr4   _   s3   € õ ˜ ¨(Ñ
3Ô
3€CÝÔ  ¤°YÐ?Ñ?Ô?Ð?Ð?Ð?r   N)
r*   Ú
__import__r   Útwisted.pythonr   r+   ÚLOG_USERr,   r   r4   r-   r   r   ú<module>r8      s£   ðð
ð ð 
ˆ�HÑ	Ô	€à Ð Ð Ð Ð Ð ð €Ø”?Ð ðHð Hð Hð Hð Hñ Hô Hð HðX ˜oÐ8HÐTUð@ð @ð @ð @ð @ð @r   