ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
Yc           @@ s   d  Z  d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l	 m
 Z
 d d l m Z d e j f d	     YZ d S(
   s   
raven.handlers.logbook
~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
i    (   t   absolute_import(   t   print_functionN(   t   string_types(   t   Client(   t	   to_stringt   SentryHandlerc           B@ s#   e  Z d    Z d   Z d   Z RS(   c         O@ s   t  |  d k r | d } t | t  rO | j d t  d | |  |  _ n7 t | t  rj | |  _ n t d |  j j | f   g  } n6 y | j d  |  _ Wn t	 k
 r t
 d   n Xt t |   j | |   d  S(   Ni   i    t
   client_clst   dsnsS   The first argument to %s must be either a Client instance or a DSN, got %r instead.t   clients3   Expected keyword argument for SentryHandler: client(   t   lent
   isinstanceR   t   popR   R   t
   ValueErrort	   __class__t   __name__t   KeyErrort	   TypeErrort   superR   t   __init__(   t   selft   argst   kwargst   arg(    (    sG   /opt/alt/python27/lib/python2.7/site-packages/raven/handlers/logbook.pyR      s    
$		c         C@ s   yI | j  j d  r; t t |  j |   d t j d  S|  j |  SWn t k
 r |  j	 j
 rk   n  t d d t j t t | j  d t j t t t j     y |  j	 j   Wq t k
 r q Xn Xd  S(   Ns   sentry.errorst   ravent   files>   Top level Sentry exception caught - failed creating log record(   s   sentry.errorsR   (   t   channelt
   startswitht   printR   t   formatt   syst   stderrt   _emitt	   ExceptionR   t   raise_send_errorst   msgt	   tracebackt
   format_exct   captureException(   R   t   record(    (    sG   /opt/alt/python27/lib/python2.7/site-packages/raven/handlers/logbook.pyt   emit*   s    "c         C@ sH  i t  j | j  j   d 6| j d 6} d } i | j d 6| j d 6|  j |  d 6} d | j k r| | j d | d <n  | j	 t
 k s | j	 r t | j	  r |  j j |  } | j | j |    d } | j	 | d	 <n  i | j d
 6| j d 6| j d 6| j d 6| j d 6} | j | j  |  j j | d | d | | S(   Nt   levelt   loggers   raven.events.Messaget   messaget   paramst	   formattedt   tagss   raven.events.Exceptiont   exc_infot   linenot   filenamet   functiont   processt   process_namet   datat   extra(   t   logbookt   get_level_nameR(   t   lowerR   R"   R   R   R   R.   t   Truet   allR   t   get_handlert   updatet   captureR/   R0   t	   func_nameR2   R3   R5   (   R   R&   R4   t
   event_typet   handler_kwargst   handlerR5   (    (    sG   /opt/alt/python27/lib/python2.7/site-packages/raven/handlers/logbook.pyR   >   s4    

'



(   R   t
   __module__R   R'   R   (    (    (    sG   /opt/alt/python27/lib/python2.7/site-packages/raven/handlers/logbook.pyR      s   		(   t   __doc__t
   __future__R    R   R6   R   R#   t   raven.utils.compatR   t
   raven.baseR   t   raven.utils.encodingR   t   HandlerR   (    (    (    sG   /opt/alt/python27/lib/python2.7/site-packages/raven/handlers/logbook.pyt   <module>   s   