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