Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
log.cpython-313.pyc80 linesDownload Raw Back to __pycache__
1�

2��jl�3�H�SSKJr SSKrSSKrSSKrSSKrSSKJr SSKJ	r	 SSK4Jr SSK
Jr \R(aSSKJr \R"S-r\R&"\S	5 /S5Qr\R*S\R,S\S
0r"SS\R05r"SS\R45r"SS5r"SS5r\R*S\R,S\R"S\S\R<S0r"SS\5r \"SS\	RB55r"Sr#g) �)�annotationsN)�	dataclass)�hooks)�click)�human��master��ALERT��error�warn�info�alert�debug�red�yellow�magentac�>^�\rSrSrSU4SjjrSrSrSSjrSrU=r	$)	�
MitmFormatter�$c��>�[TU]5 XlSnSnU(a,[R"USSS9n[R"USSS9nUUS3UlUS3Ulg)Nz[%s]�cyanT)�fg�dimrz %s)�super�__init__�colorize�	miniclick�style�with_client�without_client)�selfr�time�client�	__class__s    ��SD:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/log.pyr�MitmFormatter.__init__%se���
���� �
�������?�?�4�F��=�D��_�_�V��d�C�F�"�V�F�8�3�/���!%��c�l���z%H:%M:%Sz%s.%03dc���URU5nUR5nUR(a USURUR53nUR(a2[6R"U[RUR5S9n[USS5=n(a'[R"U5nURX$U4-$URX#4-$)N�7)rr%)�8formatTime�9getMessage�exc_info�formatExceptionrrr �10LOG_COLORS�get�levelno�getattrr�format_addressr!r")r#�recordr$�messager%s     r'�format�MitmFormatter.format4s������v�&���#�#�%���?�?� �	��D�$8�$8����$I�#J�K�G��=�=��o�o���>�>�&�.�.�1��G�11�V�X�t�4�4�6�4��)�)�&�1�F��#�#�t�W�&=�=�=��&�&�$��8�8r))rr!r")r�bool)r5�logging.LogRecord�return�str)12�__name__�13__module__�__qualname__�__firstlineno__r�default_time_format�default_msec_formatr7�__static_attributes__�
__classcell__�r&s@r'rr$s ���14+�%��#��9�9r)rc�L^�\rSrSrU4SjrSU4SjjrSSjrSSjrSrU=r	$)	�MitmLogHandler�Fc�n>�[TU]"U0UD6 [RR	S5Ulg�N�PYTEST_CURRENT_TEST)rr�os�environr1�_initiated_in_test)r#�args�kwargsr&s   �r'r�MitmLogHandler.__init__Gs+���
���$�)�&�)�"$�*�*�.�.�1F�"G��r)c��>�[[TU]	U5=(aD UR(+=(d, UR[R15R
S5:H5$rJ)r9r�filterrNrLrMr1)r#r5r&s  �r'rS�MitmLogHandler.filterKsO�����G�N�6�"�
��+�+�+�T��*�*�b�j�j�n�n�=R�.S�S�	16�	17r)c�R�UR(ar[[R"5R5HFn[U[5(dMURUR:wdM6UR5 MH [R"5RU5 g�N)	rN�list�logging�	getLogger�handlers�18isinstancerG�	uninstall�19addHandler)r#�hs  r'�install�MitmLogHandler.installUsl���"�"��'�+�+�-�6�6�7���q�.�1�1��,�,��0G�0G�G��K�K�M�8�	����&�&�t�,r)c�L�[R"5RU5 grV)rXrY�
removeHandler�r#s r'r\�MitmLogHandler.uninstall`s������)�)�$�/r))rN)r5r:r;r9)r;�None)20r=r>r?r@rrSr_r\rCrDrEs@r'rGrGFs���H�21�	-�0�0r)rGc�&�\rSrSrSrSrSrSrg)�LogEntry�gc�0�[U5UlX lgrV)r<�msg�level)r#rjrks   r'r�LogEntry.__init__hs���s�8����22r)c�`�[U[5(aURUR:H$g)NF)r[rg�__dict__)r#�others  r'�__eq__�LogEntry.__eq__ns%���e�X�&�&��=�=�E�N�N�2�2�r)c�<�SURSURS3$)Nz	LogEntry(z, �)�rjrkrcs r'�__repr__�LogEntry.__repr__ss���4�8�8�*�B�t�z�z�l�!�4�4r)�rkrjN)r=r>r?r@rrprurC�r)r'rgrggs����235r)rgc�F�\rSrSrSrSrSrSrSrSr	Sr24SS	jrS25rg)
�Log�wz�26The central logger, exposed to scripts as mitmproxy.ctx.log.27 28Deprecated: Please use the standard Python logging module instead.29c��XlgrVr)r#r	s  r'r�Log.__init__~s���r)c��[R"S[SS9 [R"5RU5 g)z30Log with level debug.31zamitmproxy's ctx.log.debug() is deprecated. Please use the standard Python logging module instead.���32stacklevelN)�warningsr�DeprecationWarningrXrYr�r#�txts  r'r�	Log.debug��2��	�
�
�o���	33�34	����!�!�#�&r)c��[R"S[SS9 [R"5RU5 g)z35Log with level info.36z`mitmproxy's ctx.log.info() is deprecated. Please use the standard Python logging module instead.rr�N)r�rr�rXrYrr�s  r'r�Log.info�s2��	�
�
�n���	37�38	���� � ��%r)c��[R"S[SS9 [R"5R[U5 g)z�39Log with level alert. Alerts have the same urgency as info, but40signals to interactive tools that the user's attention should be41drawn to the output even if they're not currently looking at the42event log.43zamitmproxy's ctx.log.alert() is deprecated. Please use the standard Python logging module instead.rr�N)r�rr�rXrY�logrr�s  r'r�	Log.alert�s4��	�
�
�o���	44�45	�������s�+r)c��[R"S[SS9 [R"5RU5 g)z46Log with level warn.47z`mitmproxy's ctx.log.warn() is deprecated. Please use the standard Python logging module instead.rr�N)r�rr�rXrY�warningr�s  r'r�Log.warn�s2��	�
�
�n���	48�49	����#�#�C�(r)c��[R"S[SS9 [R"5RU5 g)z50Log with level error.51zamitmproxy's ctx.log.error() is deprecated. Please use the standard Python logging module instead.rr�N)r�rr�rXrYr
r�s  r'r
�	Log.error�r�r)c���[R"S[SS9 [R"5R[R"UR55US9 g)Nz[mitmproxy's ctx.log() is deprecated. Please use the standard Python logging module instead.rr�rw)r�rr�rXrYr��getLevelName�upper)r#�textrks   r'�__call__�Log.__call__�sF���
�
�i���	52�53	������g�&:�&:�5�;�;�=�&I�t��Tr)rN)r)
r=r>r?r@�__doc__rrrrrr
r�rCrxr)r'rzrzws+����	'�	&�,�	)�	'�Ur)rzr
rrrrc�>^�\rSrSrSrSU4SjjrSSjrSrU=r$)�LegacyLogEvents��z5Emit deprecated `add_log` events from stdlib logging.c�J>�[TU]5 Xl[SS9Ulg)NF)r)rrr	r�	formatter)r#r	r&s  �r'r�LegacyLogEvents.__init__�s!���	������&��6��r)c��[URU5[RURS5S9nUR54RRUR55RR[U55 g)Nr
rt)rgr7�LOGGING_LEVELS_TO_LOGENTRYr1r2r	�56event_loop�call_soon_threadsafe�addons�trigger�57AddLogHook)r#r5�entrys   r'�emit�LegacyLogEvents.emit�sa������F�#�,�0�0�����I�58��	
�����3�3��K�K���&�&��u��	59r))r�r	)r	z
master.Master)r5r:r;re)	r=r>r?r@r�rr�rCrDrEs@r'r�r��s���?�7��7�60�61r)r�c�$�\rSrSr%SrS\S'Srg)r���a962**Deprecated:** Starting with mitmproxy 9, users should use the standard Python logging module instead, for example63by calling `logging.getLogger().addHandler()`.64 65Called whenever a new log entry is created through the mitmproxy66context. Be careful not to log from this event, which will cause an67infinite loop!68rgr�rxN)r=r>r?r@r��__annotations__rCrxr)r'r�r��s����Or)r�c�:�[SSSSSS9RU5$)zt69Comparison method for "old" LogEntry log tiers.70Ideally you should use the standard Python logging module instead.71rr72r�r)�dictr1)rks r'�log_tierr��s"��73�a�a�a�q��:�>�>�u�E�Er))$�74__future__rrXrL�typingr��dataclassesr�	mitmproxyr�mitmproxy.contribrr�mitmproxy.utilsr�
TYPE_CHECKINGr	�INFOr�addLevelName�	LogLevels�ERROR�WARNINGr0�	Formatterr�HandlerrGrgrz�DEBUGr�r��Hookr�r�rxr)r'�<module>r�s��"��	�
��!��0�!�	��� ����q�������U�G�$�
�	��m�m�U�G�O�O�X�u�i�
P�75�9�G�%�%�9�D0�W�_�_�0�B
5�
5� JU�JU�\�M�M�7��O�O�V��L�L�&�	�7��M�M�7���76�n�77�,�78����79��80�Fr)
codekingpro/portable-devtools · Team Ai