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
   