U
    
W[0  ã                   @   s   d Z dd„ ZdS )z
Logging utilities.
c                 C   s    dd„ }g }g }| D ]€\}}|r,|d |k	rn||krL|d |k	rn|  ¡  q4n"|sd| d ||ƒ¡¡ | |¡ | dt|ƒ ¡ | d ||ƒ¡¡ qd |¡S )a¨  
    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.
    @type trace: object

    @return: A multi-line string with indentation and arrows indicating the
        flow of the message through various observers.
    @rtype: L{unicode}
    c                 S   s&   t | dƒrd | | j¡S d | ¡S d S )NÚnamez	{0} ({1})z{0})ÚhasattrÚformatr   )Úobj© r   ú6/usr/lib/python3/dist-packages/twisted/logger/_util.pyÚformatWithName   s    
z#formatTrace.<locals>.formatWithNameéÿÿÿÿz{0}
z  z-> {0}
Ú )ÚpopÚappendr   ÚlenÚjoin)Ztracer   ÚresultZlineageÚparentZchildr   r   r   ÚformatTrace   s    
r   N)Ú__doc__r   r   r   r   r   Ú<module>   s   