
    U.j                    X   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 ddl	m
Z
 ddlmZmZmZmZmZmZmZ ddlmZ dd	lmZ dd
ZddZ	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 	 	 ddZddZddZ ee      Z ee      Z ee      Z ee      Z ee      Z ee      Z ee eeeeeeeeeeiZ!y)z.
structlog's native high-performance loggers.
    )annotationsN)AnyCallable   )BoundLoggerBase)CRITICALDEBUGERRORINFOLEVEL_TO_NAMENOTSETWARNING)_ASYNC_CALLING_STACK)FilteringBoundLoggerc                     y N selfeventargskws       SC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\structlog/_native.py_nopr       s        c                   K   y wr   r   r   s       r   _anopr   $   s	     s   c                R    |j                  dd        | j                  |g|i |S )Nexc_infoT)
setdefaulterrorr   s       r   	exceptionr"   (   s-     MM*d#4::e)d)b))r   c                   K   j                  dd      du rt        j                         d<   t        j                  t        j
                         j                        }t        j                         	 t        j                         j                  d fd       d{   }t        j                  |       |S 7 # t        j                  |       w xY ww)ze
    .. versionchanged:: 23.3.0
       Callsite parameters are now also collected under asyncio.
    r   TNc                 2    j                   fd      S )Nc                 0     j                   g i S r   )r!   )r   r   r   r   s   r   <lambda>z.aexception.<locals>.<lambda>.<locals>.<lambda>A   s    JDJJu$Bt$Br$Br   run)r   ctxr   r   r   s   r   r&   zaexception.<locals>.<lambda>A   s    CGGBCr   )getsysr   r   set	_getframef_backcontextvarscopy_contextasyncioget_running_looprun_in_executorreset)r   r   r   r   	scs_tokenrunnerr)   s   ````  @r   
aexceptionr7   0   s      
vvj$4':$(()?)?@I

"
"
$C.//1AAC
 

 	""9-M

 	""9-s0   A1C9.C 'C(C ,CC CCc                    t         |    S )aY  
    Create a new `FilteringBoundLogger` that only logs *min_level* or higher.

    The logger is optimized such that log levels below *min_level* only consist
    of a ``return None``.

    All familiar log methods are present, with async variants of each that are
    prefixed by an ``a``. Therefore, the async version of ``log.info("hello")``
    is ``await log.ainfo("hello")``.

    Additionally it has a ``log(self, level: int, **kw: Any)`` method to mirror
    `logging.Logger.log` and `structlog.stdlib.BoundLogger.log`.

    Compared to using *structlog*'s standard library integration and the
    `structlog.stdlib.filter_by_level` processor:

    - It's faster because once the logger is built at program start; it's a
      static class.
    - For the same reason you can't change the log level once configured. Use
      the dynamic approach of `standard-library` instead, if you need this
      feature.
    - You *can* have (much) more fine-grained filtering by :ref:`writing a
      simple processor <finer-filtering>`.

    Args:
        min_level:
            The log level as an integer. You can use the constants from
            `logging` like ``logging.INFO`` or pass the values directly. See
            `this table from the logging docs
            <https://docs.python.org/3/library/logging.html#levels>`_ for
            possible values.

    .. versionadded:: 20.2.0
    .. versionchanged:: 21.1.0 The returned loggers are now pickleable.
    .. versionadded:: 20.1.0 The ``log()`` method.
    .. versionadded:: 22.2.0
       Async variants ``alog()``, ``adebug()``, ``ainfo()``, and so forth.
    )LEVEL_TO_FILTERING_LOGGER)	min_levels    r   make_filtering_bound_loggerr;   I   s    P %Y//r   c                    	 	 	 	 d fd}d fd}	 	 	 	 	 	 	 	 	 	 	 	 d fd}||d}t        j                         D ]  \  }} ||      \  ||<   |d| <    t        |d<   t        |d<   |d   |d	<   |d
   |d<   |d   |d<   |d   |d<   |d   |d<   |d   |d<   t	        dt        j
                   d      j                          t        f|      S )z
    Create a new `FilteringBoundLogger` that only logs *min_level* or higher.

    The logger is optimized such that log levels below *min_level* only consist
    of a ``return None``.
    c                |    | k  rt         t        fS t        |    dfd}dfd}|_        d |_        ||fS )Nc                ^    |s | j                   |fi |S  | j                   ||z  fi |S r   _proxy_to_logger)r   r   r   r   names       r   methz?_make_filtering_bound_logger.<locals>.make_method.<locals>.meth   s>    ,t,,T5?B??(4((ut|BrBBr   c                x   K   |r|z  t        j                  t        j                         j                        }t        j                         	 t        j                         j                  d fd       d{    t        j                  |       y7 # t        j                  |       w xY ww)z}
            .. versionchanged:: 23.3.0
               Callsite parameters are now also collected under asyncio.
            Nc                 2     j                  fd      S )Nc                 ,     j                    fi S r   r?   r   r   rA   r   s   r   r&   zd_make_filtering_bound_logger.<locals>.make_method.<locals>.ameth.<locals>.<lambda>.<locals>.<lambda>   s     5 5 5dE HR Hr   r'   r)   r   r   rA   r   s   r   r&   zR_make_filtering_bound_logger.<locals>.make_method.<locals>.ameth.<locals>.<lambda>   s    CGGHr   )r   r,   r+   r-   r.   r/   r0   r1   r2   r3   r4   )r   r   r   r   r5   r)   rA   s   `` ` @r   amethz@_make_filtering_bound_logger.<locals>.make_method.<locals>.ameth   s     
 ,001G1GHI**,C6..0@@   %**95 %**95s0   AB:.B  BB  B:B   B77B:a
r   r   r   strr   r   r   r   returnr   )r   r   r   __name__)levelrB   rH   rA   r:   s      @r   make_methodz1_make_filtering_bound_logger.<locals>.make_method|   sL     9;U#	C	6( TFU{r   c                |    |k  ry t         |   }|s | j                  ||fi |S  | j                  |||z  fi |S r   )r   r@   )r   rN   r   r   r   rA   r:   s         r   logz)_make_filtering_bound_logger.<locals>.log   sS    9U#(4((u;;;$t$$T54<>2>>r   c                   K   |	k  ryt         |   |r|z  t        j                  t        j                         j
                        }t        j                         	 t        j                         j                  d fd       d{   }t        j                  |       |S 7 # t        j                  |       w xY ww)zq
        .. versionchanged:: 23.3.0
           Callsite parameters are now also collected under asyncio.
        Nc                 2     j                  fd      S )Nc                 ,     j                    fi S r   r?   rF   s   r   r&   zN_make_filtering_bound_logger.<locals>.alog.<locals>.<lambda>.<locals>.<lambda>   s    1D11$DDr   r'   rG   s   r   r&   z<_make_filtering_bound_logger.<locals>.alog.<locals>.<lambda>   s    Dr   )r   r   r,   r+   r-   r.   r/   r0   r1   r2   r3   r4   )
r   rN   r   r   r   r5   r6   r)   rA   r:   s
   ` ` `  @@r   alogz*_make_filtering_bound_logger.<locals>.alog   s      9U#DLE(,,S]]_-C-CD	&&(	2"335EE F !&&y1 !&&y1s0   AC%.B1 B/B1 C/B1 1CC)rQ   rU   rI   r"   r7   r!   fatalaerrorafatalwarningwarnawarningawarninfomsgainfoamsgBoundLoggerFilteringAtNotset)rN   intrL   z-tuple[Callable[..., Any], Callable[..., Any]])r   r   rN   rc   r   rK   r   r   r   r   rL   r   )r   itemsr"   r7   typer*   
capitalizer   )r:   rO   rQ   rU   methslvlrA   s   `      r   _make_filtering_bound_loggerri   t   s1   %%	6%N?&)25=@	4 47+EE"((*	T)4S)9&dUQtf:& + #E+$E,7^E'NHoE(O)$E&M:&E'N=E%L'NE&M
 !2!29h!G!R!R!T UV	 r   rJ   )
r   r   r   rK   r   r   r   r   rL   r   )r:   rc   rL   ztype[FilteringBoundLogger])"__doc__
__future__r   r1   r/   r+   typingr   r   _baser   _log_levelsr   r	   r
   r   r   r   r   r   r   r   r   r"   r7   r;   ri   BoundLoggerFilteringAtNotsetBoundLoggerFilteringAtDebugBoundLoggerFilteringAtInfoBoundLoggerFilteringAtWarningBoundLoggerFilteringAtErrorBoundLoggerFilteringAtCriticalr9   r   r   r   <module>ru      s   #   
   "   . (*
*'**36*>A**
'*36>A2(0VdP  <FC :5A 9$?  <W E :5A !=h!G  ,	&*
$	&
( r   