Hacked By AnonymousFox
�
�܋f� � � � d Z ddlmZ ddlmZ ddlZddlZddlZddlmZ ddl m
Z
ddlmZ G d� 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 �* � � e Zd Z� fd�Zd� Zd� Z� xZS )�
SentryHandlerc �� �� t |� � dk r�|d }t |t � � r) |� dt � � d
d|i|��| _ n=t |t � � r|| _ n t
d| j j �d|�d�� � �g }n9 |� d� � | _ n# t $ r t d � � �w xY w t t | � � j
|i |�� d S )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 �popr r �
ValueError� __class__�__name__�KeyError� TypeError�superr �__init__)�self�args�kwargs�argr s ��g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/raven/handlers/logbook.pyr zSentryHandler.__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=t t | � |� � � � t
j �� � d S | � |� � S # t $ r� | j j
r� t dt
j �� � t t |j � � t
j �� � t t t j
� � � � � � | j � � � Y d S # t $ r Y Y d S w xY ww xY w)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. �.BD*�;D�
D&�!D*�%D&�&D*c �Z � t j |j � � � � � |j d�}d}|j |j | � |� � d�}d|j v r|j d |d<