3
AAd][  ã               @   s&   d Z ddlZddlmZ ddd„ZdS )z† Prints a stack trace every time it is called but does not halt execution
    of the application.

    Copied from Uche Ogbuji's blog
é    N)ÚStringIOÚ
c             C   s¸   t jƒ }|dd … }|jƒ  tƒ }| r8|jt| ƒd ƒ xr|D ]j}|\}}}}}}	|jdƒr^q>|jdƒrt|dd … }|jd|||f ƒ |r>|jddj|ƒd d	…  ƒ q>W |j	ƒ }
|
S )
Né   r   z/unittest.pyz./é   z%s:%s in %s:
z  %s
Ú éÿÿÿÿ)
ÚinspectÚstackÚreverser   ÚwriteÚstrÚendswithÚ
startswithÚjoinÚgetvalue)Úmsgr	   ÚoutputZ	stackLineÚframeÚfilenameÚlineÚfuncnameÚlinesÚunknownÚs© r   úu/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/apptools-4.4.0-py3.6.egg/apptools/logger/log_point.pyÚ	log_point   s"    


 r   )r   )Ú__doc__r   Úior   r   r   r   r   r   Ú<module>   s   