
    	h5                       U d Z ddlmZ ddlZddlZddlZddlmZmZm	Z	m
Z
mZmZ ddlmZ ddlmZ ddlmZ dd	lmZmZmZ dd
lmZmZmZ ddlmZmZmZmZ 	 ee e            e edd           eej                             dd          dk    oSej                             dd          dk    p4eo2ej!        duo) e"ej!        d          oej!        #                                          gZ$de%d<    eee         e&          Z' ed          Z( e            Z)dZ* G d d          Z+ e+            Z,	 d6dZ-d7dZ.d8d Z/e/Z0	 	 	 	 	 	 d9d:d-Z1	 	 	 	 	 d9d;d1Z2	 	 	 	 	 d9d;d2Z3d<d3Z4 G d4 d5          Z5dS )=zJ
Global state department.  Don't reload this module or everything breaks.
    )annotationsN)AnyCallableIterableSequenceTypecast   )make_filtering_bound_logger)PrintLoggerFactory)merge_contextvars)ConsoleRenderer_has_colorsset_exc_info)StackInfoRendererTimeStamperadd_log_level)BindableLoggerContext	ProcessorWrappedLoggerz%Y-%m-%d %H:%M:%SF)fmtutcNO_COLOR FORCE_COLORisatty)colorszSequence[Processor]_BUILTIN_DEFAULT_PROCESSORSc                  x    e Zd ZU dZdZded<   edd         Zded<   eZ	ded	<   e
Zd
ed<   eZded<   eZded<   dS )_Configurationz
    Global defaults.
    Fboolis_configuredNzIterable[Processor]default_processorsztype[Context]default_context_classr   default_wrapper_classzCallable[..., WrappedLogger]logger_factorycache_logger_on_first_use)__name__
__module____qualname____doc__r#   __annotations__r   r$   _BUILTIN_DEFAULT_CONTEXT_CLASSr%   _BUILTIN_DEFAULT_WRAPPER_CLASSr&   _BUILTIN_DEFAULT_LOGGER_FACTORYr'   "_BUILTIN_CACHE_LOGGER_ON_FIRST_USEr(        ^/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/structlog/_config.pyr!   r!   9   s            M.I!!!.LLLLL+IIIII!????? 	(  ( ( ( ( 'IHHHHHHr3   r!   returnr"   c                     t           j        S )z
    Return whether *structlog* has been configured.

    If `False`, *structlog* is running with builtin defaults.

    .. versionadded: 18.1.0
    )_CONFIGr#   r2   r3   r4   r#   r#   N   s       r3   dict[str, Any]c                 v    t           j        t           j        t           j        t           j        t           j        dS )z
    Get a dictionary with the current configuration.

    .. note::

       Changes to the returned dictionary do *not* affect *structlog*.

    .. versionadded: 18.1.0
    )
processorscontext_classwrapper_classr'   r(   )r7   r$   r%   r&   r'   r(   r2   r3   r4   
get_configr=   Y   s1     0 6 6!0%,%F  r3   argsr   initial_valuesc                     t          dd| i|S )ar  
    Convenience function that returns a logger according to configuration.

    >>> from structlog import get_logger
    >>> log = get_logger(y=23)
    >>> log.info("hello", x=42)
    y=23 x=42 event='hello'

    Arguments:

        args:
            *Optional* positional arguments that are passed unmodified to the
            logger factory.  Therefore it depends on the factory what they
            mean.

        initial_values: Values that are used to pre-populate your contexts.

    Returns:

        A proxy that creates a correctly configured bound logger when
        necessary. The type of that bound logger depends on your configuration
        and is `structlog.BoundLogger` by default.

    See `configuration` for details.

    If you prefer CamelCase, there's an alias for your reading pleasure:
    `structlog.getLogger`.

    .. versionadded:: 0.4.0 *args*
    Nlogger_factory_argsN)wrap_logger)r>   r?   s     r4   
get_loggerrD   l   s    > HHHHHHr3   loggerWrappedLogger | Noner:   Iterable[Processor] | Noner<   type[BindableLogger] | Noner;   type[Context] | Noner(   bool | NonerA   Iterable[Any] | Nonec           	     .    t          | ||||||          S )aJ  
    Create a new bound logger for an arbitrary *logger*.

    Default values for *processors*, *wrapper_class*, and *context_class* can
    be set using `configure`.

    If you set an attribute here, `configure` calls have *no* effect for the
    *respective* attribute.

    In other words: selective overwriting of the defaults while keeping some
    *is* possible.

    Arguments:

        initial_values: Values that are used to pre-populate your contexts.

        logger_factory_args:
            Values that are passed unmodified as ``*logger_factory_args`` to
            the logger factory if not `None`.

    Returns:

        A proxy that creates a correctly configured bound logger when
        necessary.

    See `configure` for the meaning of the rest of the arguments.

    .. versionadded:: 0.4.0 *logger_factory_args*
    )r<   r:   r;   r(   r?   rA   )BoundLoggerLazyProxy)rE   r:   r<   r;   r(   rA   r?   s          r4   rC   rC      s1    L  ##";%/   r3   r'   #Callable[..., WrappedLogger] | NoneNonec                    dt           _        | | t           _        ||t           _        ||t           _        ||t           _        ||t           _        dS dS )a   
    Configures the **global** defaults.

    They are used if `wrap_logger` or `get_logger` are called without
    arguments.

    Can be called several times, keeping an argument at `None` leaves it
    unchanged from the current setting.

    After calling for the first time, `is_configured` starts returning `True`.

    Use `reset_defaults` to undo your changes.

    Arguments:

        processors: The processor chain. See :doc:`processors` for details.

        wrapper_class:
            Class to use for wrapping loggers instead of
            `structlog.BoundLogger`.  See `standard-library`, :doc:`twisted`,
            and `custom-wrappers`.

        context_class:
            Class to be used for internal context keeping. The default is a
            `dict` and since dictionaries are ordered as of Python 3.6, there's
            few reasons to change this option.

        logger_factory:
            Factory to be called to create a new logger that shall be wrapped.

        cache_logger_on_first_use:
            `wrap_logger` doesn't return an actual wrapped logger but a proxy
            that assembles one when it's first used. If this option is set to
            `True`, this assembled logger is cached. See `performance`.

    .. versionadded:: 0.3.0 *cache_logger_on_first_use*
    TN)r7   r#   r$   r&   r%   r'   r(   r:   r<   r;   r'   r(   s        r4   	configurerR      sa    X !G%/" (5% (5%!!/ ,,E))) -,r3   c                    t           j        st          | ||||           dS t          j        dt
          d           dS )z
    Configures if structlog isn't configured yet.

    It does *not* matter whether it was configured using `configure` or
    `configure_once` before.

    Raises:

        RuntimeWarning: if repeated configuration is attempted.
    rQ   z!Repeated configuration attempted.   )
stacklevelN)r7   r#   rR   warningswarnRuntimeWarningrQ   s        r4   configure_oncerY     sk    "   
!'')&?	
 	
 	
 	
 	
 	
 	/A	
 	
 	
 	
 	
 	
r3   c                     dt           _        t          dd         t           _        t          t           _        t          t           _        t          t           _	        t          t           _        dS )zu
    Resets global default values to builtin defaults.

    `is_configured` starts returning `False` afterwards.
    FN)r7   r#   r   r$   r/   r&   r.   r%   r0   r'   r1   r(   r2   r3   r4   reset_defaultsr[   !  sC     "G!<QQQ!?G$BG!$BG!<G(JG%%%r3   c                  h    e Zd ZdZ	 	 	 	 	 	 d#d$dZd%dZd&dZd'dZd'dZd&dZ	d(dZ
d)d Zd*d"ZdS )+rM   a  
    Instantiates a bound logger on first usage.

    Takes both configuration and instantiation parameters into account.

    The only points where a bound logger changes state are ``bind()``,
    ``unbind()``, and ``new()`` and that return the actual ``BoundLogger``.

    If and only if configuration says so, that actual bound logger is cached on
    first usage.

    .. versionchanged:: 0.4.0 Added support for *logger_factory_args*.
    NrE   rF   r<   rH   r:   rG   r;   rI   r(   rJ   r?   dict[str, Any] | NonerA   r   r5   rO   c                p    || _         || _        || _        || _        || _        |pi | _        |pd| _        d S )Nr2   )_logger_wrapper_class_processors_context_class_cache_logger_on_first_use_initial_values_logger_factory_args)selfrE   r<   r:   r;   r(   r?   rA   s           r4   __init__zBoundLoggerLazyProxy.__init__>  sK     +%+*C'-3$7$=2!!!r3   strc                h    d| j         d| j        d| j        d| j        d| j        d| j        dS )Nz<BoundLoggerLazyProxy(logger=z, wrapper_class=z, processors=z, context_class=z, initial_values=z, logger_factory_args=z)>)r_   r`   ra   rb   rd   re   rf   s    r4   __repr__zBoundLoggerLazyProxy.__repr__P  s    CDL C C"C C373CC C!0C C #2C C $(#<	C C C	
r3   
new_valuesr   c                   | j         r|                      | j                  }nt                              | j                  }| j        }|st          j        | j         }| j        t          j        }n| j        }| j	        pt          j
        } ||||          d	fd}| j        du s| j        t          j        du r|| _         |d
i |S )zN
        Assemble a new BoundLogger from arguments and configuration.
        N)r:   contextrl   r   r5   r   c                 &    | r j         di | S S )zU
            Use cached assembled logger to bind potentially new values.
            r2   )bind)rl   rE   s    r4   finalized_bindz1BoundLoggerLazyProxy.bind.<locals>.finalized_bindr  s*      1"v{00Z000Mr3   Trl   r   r5   r   r2   )rb   rd   r7   r%   r_   r'   re   ra   r$   r`   r&   rc   r(   rp   )rf   rl   ctxr_   procsclsrq   rE   s          @r4   rp   zBoundLoggerLazyProxy.bindY  s     	F%%d&:;;CC//0DEEC, 	I,d.GHG#.EE$E!BW%B s
 
 
	 	 	 	 	 	 *d22+31T99&DI~++
+++r3   keysc                :     |                                  j        | S )zs
        Same as bind, except unbind *keys* first.

        In our case that could be only initial values.
        )rp   unbindrf   rv   s     r4   rx   zBoundLoggerLazyProxy.unbind  s     "tyy{{!4((r3   c                :     |                                  j        | S rB   )rp   
try_unbindry   s     r4   r{   zBoundLoggerLazyProxy.try_unbind  s    %tyy{{%t,,r3   c                    | j         r'|                                                                   n+t                                                                            | j        di |S )z+
        Clear context, then bind.
        r2   )rb   clearr7   r%   rp   )rf   rl   s     r4   newzBoundLoggerLazyProxy.new  sf      	4!!''))))))++11333ty&&:&&&r3   namec                d    |dk    rt           |                                 }t          ||          S )zz
        If a logging method if called on a lazy proxy, we have to create an
        ephemeral BoundLogger first.
        __isabstractmethod__)AttributeErrorrp   getattr)rf   r   bls      r4   __getattr__z BoundLoggerLazyProxy.__getattr__  s3    
 )))  YY[[r4   r3   r8   c                    | j         S )=
        Our __getattr__ magic makes this necessary.
        )__dict__rj   s    r4   __getstate__z!BoundLoggerLazyProxy.__getstate__  s     }r3   statec                \    |                                 D ]\  }}t          | ||           dS )r   N)itemssetattr)rf   r   kvs       r4   __setstate__z!BoundLoggerLazyProxy.__setstate__  s>     KKMM 	  	 DAqD!Q	  	 r3   )NNNNNN)rE   rF   r<   rH   r:   rG   r;   rI   r(   rJ   r?   r]   rA   r   r5   rO   )r5   rh   rr   )rv   rh   r5   r   )r   rh   r5   r   r5   r8   )r   r8   r5   rO   )r)   r*   r+   r,   rg   rk   rp   rx   r{   r~   r   r   r   r2   r3   r4   rM   rM   /  s         " 6:15.21504#'> > > > >$
 
 
 
(, (, (, (,T) ) ) )- - - -	' 	' 	' 	'
! 
! 
! 
!              r3   rM   )r5   r"   r   )r>   r   r?   r   r5   r   )NNNNN)rE   rF   r:   rG   r<   rH   r;   rI   r(   rJ   rA   rK   r?   r   r5   r   )r:   rG   r<   rH   r;   rI   r'   rN   r(   rJ   r5   rO   )r5   rO   )6r,   
__future__r   ossysrV   typingr   r   r   r   r   r	   _log_levelsr   _outputr   contextvarsr   devr   r   r   r:   r   r   r   r   r   r   r   environgetstdouthasattrr   r   r-   dictr.   r/   r0   r1   r!   r7   r#   r=   rD   	getLoggerrC   rR   rY   r[   rM   r2   r3   r4   <module>r      s     # " " " " " 				 



  @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 4 4 4 4 4 4 ' ' ' ' ' ' * * * * * * ; ; ; ; ; ; ; ; ; ; E E E E E E E E E E E E E E E E E E E E E E K'U333Oz~~j"--3 	
JNN="--3  (Jd*(GCJ11( J%%''  4     & "&d7mT!:!: !<!<Q!?!? "4"4"6"6 %* "I I I I I I I I .


! ! ! !   &I I I ID 	 .215*.-104. . . . .d .215*.:>-17F 7F 7F 7F 7Fv .215*.:>-1
 
 
 
 
>K K K KA  A  A  A  A  A  A  A  A  A r3   