o
    bx                     @   s>   d Z ddlmZ ddlmZ ddlmZ dedefdd	Zd
S )z
Logging utilities.
    )List   )LogTrace)Loggertracereturnc                 C   s   dt dtfdd}g }g }| D ]F\}}|r|d |urA||v r0|d |ur/|  |d |us%n|s<||| d || |dt|  |d|| d qd	|S )
ay  
    Format a trace (that is, the contents of the C{log_trace} key of a log
    event) as a visual indication of the message's propagation through various
    observers.

    @param trace: the contents of the C{log_trace} key from an event.

    @return: A multi-line string with indentation and arrows indicating the
        flow of the message through various observers.
    objr   c                 S   s"   t | dr|  d| j dS |  S )Nnamez ())hasattrr	   )r    r   6/usr/lib/python3/dist-packages/twisted/logger/_util.pyformatWithName   s   
z#formatTrace.<locals>.formatWithName
z  z->  )objectstrpopappendlenjoin)r   r   resultlineageparentchildr   r   r   formatTrace   s    

r   N)	__doc__typingr   _interfacesr   _loggerr   r   r   r   r   r   r   <module>   s
   