Mini Shell

Direktori : /lib/python3.6/site-packages/blivet/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/blivet/__pycache__/storage_log.cpython-36.pyc

3

{)c
�@stddlZddlZddlZddlZddlmZejd�Zejej��dd�Z	dd�Z
d	d
�Zejdddfdd
�Z
dS)�N�)�flagsZblivetcCsLdddg}tj�}x4t|�D](\}}|d}||kr|t|�|fSqWdS)N�function_name_and_depth�log_method_call�log_method_return��unknown function?r)rr)�inspect�stack�	enumerate�len)Z
IGNORED_FUNCSr
�i�frame�
methodname�r�!/usr/lib/python3.6/storage_log.pyrsrcOs�tjs
dS|jj}t�\}}|d}d}|||g}x|D]}	|d7}|j|	�q8Wx>|j�D]2\}
}|d7}d|
j�kr�|r�d}|j|
|g�q\Wt	j|f|��dS)N� z%s%s.%s:z %s ;z	 %s: %s ;�passZSkipped)
r�debug�	__class__�__name__r�append�items�lower�extend�log)�d�args�kwargs�	classnamer�depth�spaces�fmt�fmt_args�arg�k�vrrrrs 


rcCs>|jj}t�\}}|d}d}||||f}tj|f|��dS)Nrz%s%s.%s returned %s)rrrrr)rZretvalrrr r!r"r#rrrr1s
rTc
Cs�|pg}t�\}}|d}|r&d|n|}|d|�|rPd|}|||f|��|d|�tjtj��}x"dd�|D�D]}	|d||	�qxW|d	|�d
S)aLog detailed exception information.

       :param log_func: the desired logging function
       :param str fmt_str: a format string for any additional message
       :param fmt_args: arguments for the format string
       :type fmt_args: a list of str
       :param bool ignored: True if no action is taken regarding the exception

       Note: the logging function indicates the severity level of
       this exception according to the calling function. log.debug,
       the default, is the lowest level.

       Note: If the ignored flag is set, each line of the exception information
       is prepended with an 'IGNORED' prefix.
    rzIGNORED:z%sCaught exception, continuing.z%sProblem description: z%sBegin exception details.css*|]"}|jd�D]}|r|j�VqqdS)�
N)�split�rstrip)�.0�entry�lrrr�	<genexpr>Tsz%log_exception_info.<locals>.<genexpr>z%s    %sz%sEnd exception details.N)r�	traceback�format_exception�sys�exc_info)
Zlog_funcZfmt_strr#ZignoredZ_methodnamer �indent�prefix�tb�linerrr�log_exception_info:s


r6)r	Zloggingr0r.rZ	getLoggerrZ
addHandlerZNullHandlerrrrrr6rrrr�<module>s