Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/raven/handlers/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/raven/handlers/__pycache__/logbook.cpython-311.pyc

�

�܋f����dZddlmZddlmZddlZddlZddlZddlmZddl	m
Z
ddlmZGd�d	ej
��ZdS)
z�
raven.handlers.logbook
~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
�)�absolute_import)�print_functionN)�string_types)�Client)�	to_stringc�*��eZdZ�fd�Zd�Zd�Z�xZS)�
SentryHandlerc����t|��dkr�|d}t|t��r)|�dt��d
d|i|��|_n=t|t��r||_n t
d|jj�d|�d����g}n9	|�d��|_n#t$rtd	���wxYwtt|��j
|i|��dS)N�r�
client_cls�dsnzThe first argument to z0 must be either a Client instance or a DSN, got z	 instead.�clientz3Expected keyword argument for SentryHandler: client�)�len�
isinstancer�poprr�
ValueError�	__class__�__name__�KeyError�	TypeError�superr	�__init__)�self�args�kwargs�argrs    ��g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/raven/handlers/logbook.pyrzSentryHandler.__init__s����t�9�9��>�>��q�'�C��#�|�,�,�
�>�f�j�j��v�>�>�Q�Q�3�Q�&�Q�Q�����C��(�(�
�!���� �j��N�+�+�+��C�C�"�����D�D�
W�$�j�j��2�2������
W�
W�
W�� U�V�V�V�
W����+��m�T�"�"�+�T�<�V�<�<�<�<�<s�B7�7Cc�Z�	|j�d��r=tt|�|����t
j���dS|�|��S#t$r�|j	j
r�tdt
j���tt|j��t
j���tttj
������	|j	���YdS#t$rYYdSwxYwwxYw)N)z
sentry.errors�raven)�filez>Top level Sentry exception caught - failed creating log record)�channel�
startswith�printr�format�sys�stderr�_emit�	Exceptionr�raise_send_errors�msg�	traceback�
format_exc�captureException)r�records  r�emitzSentryHandler.emit*s'��	��~�(�(�)C�D�D�
��i����F� 3� 3�4�4�3�:�F�F�F�F����:�:�f�%�%�%���
	�
	�
	��{�,�
���R�Y\�Yc�d�d�d�d��)�F�J�'�'�c�j�9�9�9�9��)�I�0�2�2�3�3�4�4�4�
���,�,�.�.�.�.�.�.���
�
�
�����
����
	���s1�AA.�A.�.BD*�;D�
D&�!D*�%D&�&D*c�Z�tj|j�����|jd�}d}|j|j|�|��d�}d|jvr|jd|d<|j	dus|j	rZt|j	��rF|j�|��}|�
|jd
i|����d}|j	|d<|j|j|j|j|jd�}|�
|j��|jj|f||d	�|��S)N)�level�loggerzraven.events.Message)�message�params�	formatted�tagsTzraven.events.Exception�exc_info)�lineno�filename�function�process�process_name)�data�extrar)�logbook�get_level_namer2�lowerr"r+rr%rr8�allr�get_handler�update�capturer9r:�	func_namer<r=r?)rr/r>�
event_type�handler_kwargs�handlerr?s       rr(zSentryHandler._emit>s`���+�F�L�9�9�?�?�A�A��n�
�
��
,�
��z��k����V�,�,�
�
���V�]�"�"�%+�]�6�%:�N�6�"��?�d�"�"�v��"�3�v��;O�;O�"��k�-�-�j�9�9�G��K�K����9�9�.�9�9�:�:�:�1�J�)/��N�:�&��m����(��~�"�/�
�
��	���V�\�"�"�"�"�t�{�"�:�
���
�
��
�
�	
�)r�
__module__�__qualname__rr0r(�
__classcell__)rs@rr	r	sV�������=�=�=�=�=�(���('
�'
�'
�'
�'
�'
�'
rKr	)�__doc__�
__future__rrr@r&r,�raven.utils.compatr�
raven.baser�raven.utils.encodingr�Handlerr	rrKr�<module>rUs�����'�&�&�&�&�&�%�%�%�%�%�%�����
�
�
�
�����+�+�+�+�+�+�������*�*�*�*�*�*�P
�P
�P
�P
�P
�G�O�P
�P
�P
�P
�P
rK

Hacked By AnonymousFox1.0, Coded By AnonymousFox