Ë
    >Øïiß  ã                   ó&   — d Z ddlZddlZddlZd„ Zy)z
Diagnostic utilities
é    Nc                 ó   ‡ — ˆ fd„}|S )aÌ  Create a decorator that logs and reraises any exceptions that escape
    the decorated function

    :param logging.Logger logger:
    :returns: the decorator
    :rtype: callable

    Usage example

    import logging

    from pika.diagnostics_utils import create_log_exception_decorator

    _log_exception = create_log_exception_decorator(logging.getLogger(__name__))

    @_log_exception
    def my_func_or_method():
        raise Exception('Oops!')

    c                 óF   •‡ — t        j                  ‰ «      ˆ ˆfd„«       }|S )z£The decorator returned by the parent function

        :param func: function to be wrapped
        :returns: the function wrapper
        :rtype: callable
        c            
      ó¨   •— 	  ‰| i |¤ŽS #  ‰j                  ddj                  t        j                  t	        j
                  «       Ž «      «       ‚ xY w)að  The wrapper function returned by the decorator. Invokes the
            function with the given args/kwargs and returns the function's
            return value. If the function exits with an exception, logs the
            exception traceback and re-raises the

            :param args: positional args passed to wrapped function
            :param kwargs: keyword args passed to wrapped function
            :returns: whatever the wrapped function returns
            :rtype: object
            z6Wrapped func exited with exception. Caller's stack:
%sÚ )Ú	exceptionÚjoinÚ	tracebackÚformat_exceptionÚsysÚexc_info)ÚargsÚkwargsÚfuncÚloggers     €€úO/var/www/html/aiagents/fe/lib/python3.12/site-packages/pika/diagnostic_utils.pyÚlog_exception_func_wrapzVcreate_log_exception_decorator.<locals>.log_exception.<locals>.log_exception_func_wrap(   sS   ø€ ðÙ˜TÐ, VÑ,Ð,øðØ× Ñ ØNØ—G‘GœI×6Ñ6¼¿¹»ÐGÓHôJð ús
   ƒ ‹AA)Ú	functoolsÚwraps)r   r   r   s   ` €r   Úlog_exceptionz5create_log_exception_decorator.<locals>.log_exception    s(   ù€ ô 
�‰˜Ó	ô	ó 
ð	ð& 'Ð&ó    © )r   r   s   ` r   Úcreate_log_exception_decoratorr   
   s   ø€ ô,'ð< Ðr   )Ú__doc__r   r   r	   r   r   r   r   ú<module>r      s   ðñó Û 
Û ó4r   