
    	hb                    b    d dl mZ d dlZd dlZd dlmZ d dlmZ ddlm	Z	 ddZ
	 dddZddZdS )    )annotationsN)StringIO)	FrameType   )ExcInfoexc_infor   returnstrc                   | dk    rdS t                      }t          j        | d         | d         | d         d|           |                                }|                                 |dd         dk    r
|dd         }|S )	z`
    Prettyprint an `exc_info` tuple.

    Shamelessly stolen from stdlib's logging module.
    )NNNMISSINGr   r      N
)r   	tracebackprint_exceptiongetvalueclose)r   sioss      ^/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/structlog/_frames.py_format_exceptionr      s     %%%y
**Chqk8A;T3OOOAIIKKKv~~crcFH    additional_ignoreslist[str] | Nonetuple[FrameType, str]c                t   dg| pg z   }t          j                    }|j                            d          pdt	          t          fd|D                                 rU|j        dnK|j        }|j                            d          pdt	          t          fd|D                                 U|fS )z
    Remove all intra-structlog calls and return the relevant app frame.

    Arguments:

        additional_ignores:
            Additional names with which the first frame must not start.

    Returns:

        tuple of (frame, name)
    	structlog__name__?c              3  B   K   | ]}                     |          V  d S N)
startswith).0inames     r   	<genexpr>z1_find_first_app_frame_and_name.<locals>.<genexpr>7   s/      881DOOA&&888888r   )sys	_getframe	f_globalsgetanytuplef_back)r   ignoresfr%   s      @r   _find_first_app_frame_and_namer0   %   s     m17R8GA;??:&&-#D
e888888888
9
9 28DH{z**1c e888888888
9
9 2 d7Nr   framer   c                    t                      }|                    d           t          j        | |           |                                }|d         dk    r
|dd         }|                                 |S )z?
    Pretty-print the stack of *frame* like logging would.
    zStack (most recent call last):
)filer   r   N)r   writer   print_stackr   r   )r1   r   sinfos      r   _format_stackr7   @   sq     **CII0111%c****LLNNERyDcrc
IIKKKLr   )r   r   r	   r
   r!   )r   r   r	   r   )r1   r   r	   r
   )
__future__r   r'   r   ior   typesr   typingr   r   r0   r7    r   r   <module>r=      s    # " " " " " 



                         * ,0    6     r   