<s> import os <EOL> class SentryLogger ( object ) : <EOL> def __init__ ( self ) : <EOL> try : <EOL> import raven <EOL> self . enabled = True <EOL> dsn = os . environ [ '<STR_LIT>' ] <EOL> if dsn . startswith ( '<STR_LIT>' ) : <EOL> dsn = dsn . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . client = raven . Client ( dsn ) <EOL> except ( ImportError , KeyError ) : <EOL> self . enabled = False <EOL> def capture ( self , failure ) : <EOL> if self . enabled : <EOL> self . client . captureException ( ( failure . type , failure . value , failure . getTracebackObject ( ) ) ) <EOL> capture = SentryLogger ( ) . capture </s>
