o
    ¥ÜÓhd  ã                   @  sH   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ deƒZ	dS )	z.
Generic bound logger that can wrap anything.
é    )Úannotations)Úpartial)ÚAny)ÚBoundLoggerBasec                   @  s.   e Zd ZdZddd„Zdd	d
„Zddd„ZdS )ÚBoundLoggeraÐ  
    A generic BoundLogger that can wrap anything.

    Every unknown method will be passed to the wrapped *logger*. If that's too
    much magic for you, try `structlog.stdlib.BoundLogger` or
    `structlog.twisted.BoundLogger` which also take advantage of knowing the
    wrapped class which generally results in better performance.

    Not intended to be instantiated by yourself.  See
    :func:`~structlog.wrap_logger` and :func:`~structlog.get_logger`.
    Úmethod_nameÚstrÚreturnr   c                 C  s(   |dkrdS t | j|ƒ}t| ||ƒ |S )zX
        If not done so yet, wrap the desired logger method & cache the result.
        Ú__deepcopy__N)r   Ú_proxy_to_loggerÚsetattr)Úselfr   Úwrapped© r   úH/var/www/html/ai/venv/lib/python3.10/site-packages/structlog/_generic.pyÚ__getattr__   s
   zBoundLogger.__getattr__údict[str, Any]c                 C  s   | j S )ú=
        Our __getattr__ magic makes this necessary.
        )Ú__dict__)r   r   r   r   Ú__getstate__+   s   zBoundLogger.__getstate__ÚstateÚNonec                 C  s"   |  ¡ D ]
\}}t| ||ƒ qdS )r   N)Úitemsr   )r   r   ÚkÚvr   r   r   Ú__setstate__1   s   ÿzBoundLogger.__setstate__N)r   r   r	   r   )r	   r   )r   r   r	   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s
    

r   N)
r   Ú
__future__r   Ú	functoolsr   Útypingr   Ústructlog._baser   r   r   r   r   r   Ú<module>   s   