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__/logging.cpython-311.pyc

�

�܋fd����dZddlmZddlmZddlZddlZddlZddlZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZed	��Zed
��Zeefd�ZGd�d
eje��ZdS)z�
raven.handlers.logging
~~~~~~~~~~~~~~~~~~~~~~

: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�	iteritems�	text_type)�Client)�	to_string)�iter_stack_frames)�stack�name�module�funcName�args�msg�levelno�exc_text�exc_info�data�created�	levelname�msecs�relativeCreated�tags�message)�user�culprit�server_name�fingerprintc�,�i}t|dd��}t|t��s
|rd|i}ni}nt|��}tt	|����D]3\}}||vr�
|�d��r� d|vr
||vr|||<�.|||<�4||fS)Nr�_�.)�getattr�
isinstance�dictr�vars�
startswith)�record�reserved�
contextualr�extra�k�vs       �M/opt/cloudlinux/venv/lib64/python3.11/site-packages/raven/handlers/logging.py�
extract_extrar."s���
�D��F�F�D�)�)�E��e�T�"�"���	��U�O�E�E��E�E��U�����$�v�,�,�'�'�����1���=�=���<�<����	���a�<�<�A�Z�/�/��E�!�H�H��D��G�G���;��c�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�
SentryHandlerc�(�|�dt��}t|��dkrj|d}t|t��r|dd|i|��|_n\t|t��r||_n?t
d|jj�d|�d����d|vr|d|_n
||i|��|_|�	d	d��|_
tj�
||�d
tj�����dS)
N�
client_cls�r�dsnzThe first argument to z0 must be either a Client instance or a DSN, got z	 instead.�clientr�level)r7�)�getr�lenr#rr6�
ValueError�	__class__�__name__�popr�logging�Handler�__init__�NOTSET)�selfr�kwargsr6�args     r-rAzSentryHandler.__init__=s"�����L�&�1�1���t�9�9��>�>��q�'�C��#�|�,�,�
B�$�f�7�7��7��7�7�����C��(�(�
B�!���� �j�"&�.�"9�"9�"9�3�3�3�"A�B�B�B���
�
� ��*�D�K�K� �&�$�1�&�1�1�D�K��J�J�v�t�,�,��	��� � ��V�Z�Z����-P�-P� �Q�Q�Q�Q�Qr/c�N�|jdkp|j�d��S)N�raven)z
sentry.errorszraven.)rr&�rCr's  r-�
can_recordzSentryHandler.can_recordRs0���K�7�"�
C��{�%�%�&A�B�B�
�	
r/c��	|�|��|�|��s/tt|j��t
j���dS|�|��S#t$r�|j	j
r�tdt
j���tt|j��t
j���tttj
����t
j���YdSwxYw)N)�filez>Top level Sentry exception caught - failed creating log record)�formatrI�printr	r�sys�stderr�_emit�	Exceptionr6�raise_send_errorsr�	traceback�
format_excrHs  r-�emitzSentryHandler.emitXs��	F��K�K������?�?�6�*�*�
��i���/�/�c�j�A�A�A�A����:�:�f�%�%�%���	F�	F�	F��{�,�
���(�.1�j�
:�
:�
:�
:��)�F�J�'�'�c�j�9�9�9�9��)�I�0�2�2�3�3�#�*�E�E�E�E�E�E�E�
	F���s�AA0�A0�0BD�Dc�|�t|��}g}d}d}|D]�}t|ttf��r|\}}n	||j}}|sYt	|di��}	|	�dd��}
|r-|�d��r|
�d��sd}n|
}��|�||f����|s|S|S)NF��	f_globalsr=r?T)�listr#�tuple�f_linenor"r9r&�append)rCrr'�frames�started�last_mod�item�frame�linenorX�module_names           r-�_get_targetted_stackz"SentryHandler._get_targetted_stackjs����U�����������	+�	+�D��$��u�
�.�.�
4� $�
��v�v� $�d�m�v���

�#�E�;��;�;�	�'�m�m�J��;�;����!)�!4�!4�Y�!?�!?��'�2�2�9�=�=��#�G�G�*�H���M�M�5�&�/�*�*�*�*��	��L��
r/c	�"�t|��\}}t|dd��}|durt��}|r|�||��}tj�|j��}d}d|ji}	t|j	��|d<n/#t$r"t|j	��dd�|d<YnwxYw	t|j��|d<n/#t$r"t|j��dd�|d<YnwxYw|j
rYt|j
��rE|j�|��}	|�|	jdi|����d	}d
|j
i}|j|d<|j|d<ix|d
<}
|jr|
�|j��|
�t|d
i����|�|��|�dd��}|jj|f|||||d�|��S)NrTzraven.events.Message�paramsrr4����	formattedzraven.events.Exceptionrr7�loggerr�sample_rate)rrr*�daterjr8)r.r"r
rd�datetime�utcfromtimestamprrrr�UnicodeDecodeError�reprrr�allr6�get_handler�update�capturerrrr>)rCr'rDrr*rrk�
event_type�handler_kwargs�handlerrrjs            r-rPzSentryHandler._emit�sc��#�F�+�+���e�����.�.���D�=�=�%�'�'�E��	=��-�-�e�V�<�<�E�� �1�1�&�.�A�A��+�
��f�k�
��	?�(1�&�*�(=�(=�N�9�%�%��!�	?�	?�	?�(,�V�Z�(8�(8��2��(>�N�9�%�%�%�	?����	E�*3�F�N�*C�*C�N�;�'�'��!�	E�	E�	E�*.�v�~�*>�*>�q��t�*D�N�;�'�'�'�	E�����?�	;�s�6�?�3�3�	;��k�-�-�j�9�9�G��K�K����9�9�.�9�9�:�:�:�1�J�(�&�/�:�N����W�
����X�� "�"��v����9�	#��K�K��	�"�"�"����G�F�F�B�/�/�0�0�0��
�
�n�%�%�%��i�i�
�t�4�4��"�t�{�"���#�$��d�������	s$�>B�)C�C�C�)D
�	D
N)r=�
__module__�__qualname__rArIrUrdrPr8r/r-r1r1<sf������R�R�R�*
�
�
�F�F�F�$���B5�5�5�5�5r/r1)�__doc__�
__future__rrrlr?rNrS�raven.utils.compatrrr�
raven.baser�raven.utils.encodingr	�raven.utils.stacksr
�	frozenset�RESERVED�
CONTEXTUALr.r@�objectr1r8r/r-�<module>r�s;����'�&�&�&�&�&�%�%�%�%�%�%���������
�
�
�
�����A�A�A�A�A�A�A�A�A�A�������*�*�*�*�*�*�0�0�0�0�0�0��9������Y����
�
$,�
�����4D�D�D�D�D�G�O�V�D�D�D�D�Dr/

Hacked By AnonymousFox1.0, Coded By AnonymousFox