Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib/python3.7/site-packages/raven/handlers/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/handlers/__pycache__/logbook.cpython-37.pyc

B

��Y��@sndZddlmZddlmZddlZddlZddlZddlmZddl	m
Z
ddlmZGdd	�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_stringcs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�
SentryHandlercs�t|�dkrh|d}t|t�r<|�dt�fd|i|��|_n&t|t�rN||_ntd|jj|f��g}n.y|�d�|_Wnt	k
r�t
d��YnXtt|�j
||�dS)N�rZ
client_clsZdsnzSThe first argument to %s must be either a Client instance or a DSN, got %r instead.�clientz3Expected keyword argument for SentryHandler: client)�len�
isinstancer�poprr	�
ValueError�	__class__�__name__�KeyError�	TypeError�superr�__init__)�self�args�kwargs�arg)r��G/opt/alt/python37/lib/python3.7/site-packages/raven/handlers/logbook.pyrs


zSentryHandler.__init__cCs�y2|j�d�r*tt|�|��tjd�dS|�|�Stk
r�|j	j
rL�tdtjd�tt|j�tjd�ttt�
���y|j	��Wntk
r�YnXYnXdS)N)z
sentry.errors�raven)�filez>Top level Sentry exception caught - failed creating log record)�channel�
startswith�printr�format�sys�stderr�_emit�	Exceptionr	Zraise_send_errors�msg�	traceback�
format_excZcaptureException)r�recordrrr�emit*s
zSentryHandler.emitcCs�t�|j���|jd�}d}|j|j|�|�d�}d|jkrJ|jd|d<|j	dksd|j	r�t
|j	�r�|j�|�}|�
|jf|��d}|j	|d<|j|j|j|j|jd�}|�
|j�|jj|f||d	�|��S)
N)�level�loggerzraven.events.Message)�message�params�	formattedZtagsTzraven.events.Exception�exc_info)�lineno�filename�function�process�process_name)�data�extra)�logbookZget_level_namer)�lowerrr$rrrr.�allr	Zget_handler�update�capturer/r0�	func_namer2r3r5)rr'r4Z
event_typeZhandler_kwargs�handlerr5rrrr">s.




zSentryHandler._emit)r�
__module__�__qualname__rr(r"�
__classcell__rr)rrrsr)�__doc__�
__future__rrr6r r%Zraven.utils.compatrZ
raven.baserZraven.utils.encodingr�Handlerrrrrr�<module>s

Hacked By AnonymousFox1.0, Coded By AnonymousFox