
    \dx                     >    d Z ddlmZ ddlmZ ddlmZ dedefdZd	S )
z
Logging utilities.
    )List   )LogTrace)Loggertracereturnc                    dt           dt          fd}g }g }| D ]\  }}|r
|d         |ure||v r)|d         |ur|                                 |d         |un8|s!|                     ||           d           |                    |           |                    dt	          |          z             |                    d ||           d           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                 B    t          | d          r|  d| j         dS |  S )Nnamez ())hasattrr   )r
   s    4lib/python3.11/site-packages/twisted/logger/_util.pyformatWithNamez#formatTrace.<locals>.formatWithName   s4    3 	((SX((((8O    
z  z->  )objectstrpopappendlenjoin)r   r   resultlineageparentchilds         r   formatTracer      s,   F s     FG 7 7 		''"+V33  bk//KKMMM bk//  AMM^^F%;%;"?"?"?@@@v&&&dS\\)***5NN5115556666776??r   N)	__doc__typingr   _interfacesr   _loggerr   r   r    r   r   <module>r%      ss   
        ! ! ! ! ! !      $x $C $ $ $ $ $ $r   