o
    iS                     @   s"   d dl Z d dlZG dd dZdS )    Nc                   @   s,   e Zd Zdd Zdd Zd	ddddZdS )
ErrorInterceptorc                 C   s   || _ || _d S N)_should_catch_handler_id)selfshould_catch
handler_id r	   V/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/loguru/_error_interceptor.py__init__   s   
zErrorInterceptor.__init__c                 C   s   | j S r   )r   )r   r	   r	   r
   r   
   s   zErrorInterceptor.should_catchN)	exceptionc                C   s   t jsd S |d u rt  \}}}nt|||j}}}zKz5t jd| j  zt|}W n ty8   d}Y nw t jd|  t	
|||d t j t jd W n	 ty[   Y nw W ~~~d S W ~~~d S ~~~w )Nz,--- Logging error in Loguru Handler #%d ---
z/!\ Unprintable record /!\zRecord was: %s
z--- End of logging error ---
)sysstderrexc_infotype__traceback__writer   str	Exception	tracebackprint_exceptionOSError)r   recordr   type_value
traceback_record_reprr	   r	   r
   print   s,   
zErrorInterceptor.printr   )__name__
__module____qualname__r   r   r   r	   r	   r	   r
   r      s    r   )r   r   r   r	   r	   r	   r
   <module>   s    