관리-도구
편집 파일: test_logger.cpython-311.pyc
� �܋fQ � �h � d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZ d dl m Z n# e $ r d dlm Z Y nw xY wd e� � d� e ed� � � � d�Zd � Zd � Zedk r� ej e� � ed� � � ej d� � ed� � � ej d� � ed� � � e j Z ej e� � ej � � 5 ed� � � Zddd� � n# 1 swxY w Y ed� � � ej � � ek sJ � ee� � dS dS )� N)�detect)�stderr_handler�adapter)�StringIO)� � c � � | dz S )Nr � )�xs �g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/dill/tests/test_logger.py�<lambda>r s � �q�!�t� � � )�a�b�f�bigc � � t � � }t j |� � }t j |� � t j t � � | r�t j d� � }|� � � � � � D ]}|� |� � sJ ��|� � � t j |� � |� � � S |� � � dk sJ � t j |� � |� � � d S # t j |� � |� � � w xY w)Nu/ (\S*┬ \w.*[^)]|│*└ # \w.* \[\d+ (\wi)?B])� )r �logging� StreamHandler�logger� addHandler�dill�dumps�test_obj�re�compile�getvalue� splitlines� fullmatch� removeHandler�close)�should_trace�buffer�handler�regex�lines r �test_loggingr) s9 � � �Z�Z�F��#�F�+�+�G� ��g���� �� �8����� +��J� B� !� !�E� ���)�)�4�4�6�6� -� -�����t�,�,�,�,�,�,��?�?�$�$� ��W�%�%�%�������� �?�?�$�$��*�*�*�*�*���W�%�%�%���������� ��W�%�%�%����������s �BD( �#D( �(*Ec �( � t j d�� � }t j |j d�� � 5 t j t � � d d d � � n# 1 swxY w Y |� � � }|� � � t j d� � }|� d|� � |� d| � � } }t j d� � }|� d|� � |� d| � � } }|| k sJ �d S )N�r)�mode�wz0x[0-9A-Za-z]+�0xz(dict\.__repr__ of ).*z\1{}>) �tempfile�NamedTemporaryFiler �trace�namer r r �readr# r r �sub)�stream_trace�file� file_trace�reghex�regdicts r �test_trace_to_filer: * s- � ��&�C�0�0�0�D� ��d�i�c� *� *� *� � �� �8����� � � � � � � � � � ���� � � � ������J��J�J�L�L�L� �Z�)� *� *�F�%�z�z�$� �;�;�V�Z�Z��l�=[�=[��J��j�2�3�3�G�&�{�{�8�Z�@�@�'�+�+�h�Xd�Be�Be��J���%�%�%�%�%�%s �A�A�A�__main__F)r$ T)r r r/ r r �dill.loggerr r r r �ImportError�io�object�list�ranger r) r: �__name__r"