%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/__pycache__/log.cpython-312.pyc

�

�f����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddlm
Z
ddlmZddl
mZdZdZej"dfd�Zd�Zefd	�Zdd
�ZGd�dej,�Zd
�Zd�ZGd�dej4�Zd�Zy)�N)�defaultdict)�suppress)�DefaultDictz6%(asctime)s - %(filename)s[%(levelname)s]: %(message)s�#c�4�|xstjt�}tj�}tjt
j�}|j|�|j|�|j|�|j|�y�N)
�logging�	Formatter�DEFAULT_LOG_FORMAT�	getLogger�
StreamHandler�sys�stderr�setFormatter�setLevel�
addHandler)�level�	formatter�root�consoles    �//usr/lib/python3/dist-packages/cloudinit/log.py�setup_basic_loggingrsn���B�W�.�.�/A�B�I�����D��#�#�C�J�J�/�G�����#����U���O�O�G���M�M�%��c���|sy|jD]E}t|tj�s�t	t
�5|j
�ddd��Gt|j�y#1swY�gxYwr)	�handlers�
isinstancer	r
r�IOError�flush�
flush_loggers�parent)r�hs  rrr&sd����
�]�]����a�'�/�/�1��'�"�
����	�
�
���$�+�+��
�
�s�A.�.A7	c�f��tj�d��fd�}|tj_y)N�
DEPRECATEDc�T��|j��r|j�||fi|��yyr)�isEnabledFor�_log)�self�message�args�kwargs�lvls    �r�
deprecatedz-define_deprecation_logger.<locals>.deprecated3s-������S�!��D�I�I�c�7�D�3�F�3�"r)r	�addLevelName�Loggerr,)r+r,s` r�define_deprecation_loggerr/0s&�������l�+�4�!+�G�N�N�rc��|si}tj�}t�}|jtj�g}|jd�}|r+t
|t�r|jt|��n�d|vr�|dD]�}t
|t�r|j|��%t
|tjj�r9|D�cgc]
}t|���}}|jdj|����|jt|����d}|D]�}tt�5|dz
}|jd�rt j"j%|�st'j(|�}tj*j-|�|j/|�	ddd�y|j/|�|jdd�}	t0j2j5d	|z�|	r*t0j2j5d
�t7�yycc}w#1swY��xYw)N�logcfg�log_cfgs�
r��/�	log_basicTz0WARN: no logging configured! (tried %s configs)
zSetting up basic logging...
)r	r�LogExporterr�WARN�getr�str�append�collections�abc�Iterable�joinr�FileNotFoundError�
startswith�os�path�isfile�io�StringIO�config�
fileConfigrrr�writer)
�cfg�root_logger�exporterr2�log_cfg�a_cfg�c�cfg_str�am_tried�
basic_enableds
          r�
setup_loggingrS:s�������#�#�%�K��}�H����g�l�l�#��H��g�g�h��G��:�g�s�+�	����G��%�	�s�	���_�	,�E��%��%�����&��E�K�O�O�$<�$<�>�+0�1�a�3�q�6�1��1�����	�	�'� 2�3�����E�
�+�	,��H�
����'�
(�	���M�H��&�&�s�+������w�0G��+�+�g�.��
�N�N�%�%�g�.�
�"�"�8�,�
�	�	�	�*���8�$��G�G�K��.�M��J�J���;�x�H����
�
���8�9�����Q2�	�	�s�H8�?A<H=�=I	c�^�eZdZUee�Zeeefed<de	jfd�Zd�Zd�Z
y)r7�holder�recordc�p�|j|jj|j��yr)rU�	levelnamer;�
getMessage)r'rVs  r�emitzLogExporter.emit~s(�����F�$�$�%�,�,�V�->�->�-@�Arc�@�tj|j�Sr)�copy�deepcopyrU�r's r�export_logszLogExporter.export_logs�s���}�}�T�[�[�)�)rc��yr�r^s rrzLogExporter.flush�s��rN)�__name__�
__module__�__qualname__r�listrUrr:�__annotations__r	�	LogRecordrZr_rrarrr7r7{s8��%0��%6�F�K��T�	�"�6�B�7�,�,�B�*�
rr7c��tj�}t|j�}|D]3}|j	�|j�|j
|��5|jtj�y)z0Remove all current handlers and unset log level.N)	r	rrerr�close�
removeHandlerr�NOTSET)�logrr!s   r�
reset_loggingrm�s_��
�
�
�
�C��C�L�L�!�H�
���	���	�	���	����!����L�L���� rc����tjtj��d��_�jtjd���fd�}|tj_y)z�In the event that internal logging exception occurs and logging is not
    possible for some reason, make a desperate final attempt to log to stderr
    which may ease debugging.
    c��yrra)rVs r�<lambda>z&setup_backup_logging.<locals>.<lambda>�s�rz@FALLBACK: %(asctime)s - %(filename)s[%(levelname)s]: %(message)sc���tt�5�j|��j�ddd�y#1swYyxYw)z;A closure that emits logs on stderr when other methods failN)rr�handler)r'rV�fallback_handlers  �r�handleErrorz)setup_backup_logging.<locals>.handleError�s:���
�g�
�	%��#�#�F�+��"�"�$�	%�	%�	%�s	�"<�AN)r	r
rrrtrr
�Handler)rtrss @r�setup_backup_loggingrv�sU���
�,�,�S�Z�Z�8��#6�� ��!�!����N�	
��%�#.�G�O�O�rc�"��eZdZdZ�fd�Z�xZS)�CloudInitLogRecordz�reporting the filename as __init__.py isn't very useful in logs

    if the filename is __init__.py, use the parent directory as the filename
    c����t�|�|i|��d|jk(rLtjjtjj
|j��|_yy)Nz__init__.py)�super�__init__�filenamerBrC�basename�dirname�pathname)r'r)r*�	__class__s   �rr{zCloudInitLogRecord.__init__�sM���
���$�)�&�)��D�M�M�)��G�G�,�,�R�W�W�_�_�T�]�]�-K�L�D�M�*r)rbrcrd�__doc__r{�
__classcell__)r�s@rrxrx�s����
M�Mrrxc�P�tjtj_t�t
�t�t�}|jtj�tj�j|�tjt�y)z(Customize the root logger for cloud-initN)�time�gmtimer	r
�	converterr/rvrmr7rr8rr�setLogRecordFactoryrx)�handlers r�configure_root_loggerr��sj��#'�+�+�G���������O��m�G����W�\�\�"�����"�"�7�+���� 2�3rr)�collections.abcr<r\rEr	�logging.config�logging.handlersrBrr�r�
contextlibr�typingrrr#�DEBUGrrr/rSr
r7rmrvrgrxr�rarr�<module>r�s�����	����	�
��#���M��
�
�&�m�m�t���#-�+�>�B

�'�'�'�

�!�.�,	M��*�*�	M�4r

Zerion Mini Shell 1.0