관리-도구
편집 파일: __init__.cpython-37.pyc
B ��Y � @ s� d Z ddlmZ ddlZddlmZ ddlmZmZm Z m Z ddlmZ G dd� dej �Zdd d�Zdejfdd �ZG dd� de�ZdS )z� raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. � )�absolute_importN)�SoftTimeLimitExceeded)�after_setup_logger�task_failure�task_prerun�task_postrun)� SentryHandlerc @ s e Zd Zdd� ZdS )�CeleryFilterc C s2 t |di �}t|t�s |jdkS |�d|jdk�S )N�dataZ _log_errorZinternal)�getattr� isinstance�dict�funcName�get)�self�record� extra_data� r �N/opt/alt/python37/lib/python3.7/site-packages/raven/contrib/celery/__init__.py�filter s zCeleryFilter.filterN)�__name__� __module__�__qualname__r r r r r r s r Fc C s t | |d��� d S )N)�ignore_expected)�SentryCeleryHandler�install)�clientr r r r �register_signal s r c sB t � � t| ����|� ��� � � �fdd�}tj|dd� d S )Nc s8 x(|j D ]}t|�tkr|�� � dS qW |��� d S )NF)�handlers�typer � addFilter� addHandler)�sender�logger�loglevelZlogfile�formatZcolorize�kw�h)�filter_�handlerr r �process_logger_event( s z4register_logger_signal.<locals>.process_logger_eventF)�weak)r r �setLevelr r �connect)r r# r$ r* r )r( r) r �register_logger_signal! s r. c @ s>