Log a DEBUG/FINE message and the exception
559633
public static void d(String s, Throwable t) {
		log(Level.FINE, s, t);
	}
1042471
def log_exception(self, exc_info):
        """"""
        dsn = self.config.get("SENTRY_DSN")
        if not dsn:
            super().log_exception(exc_info)
682540
def exception_logger(exc_type, exc_value, exc_traceback):
    """"""
    if not issubclass(exc_type, KeyboardInterrupt):  # do not log Ctrl-C
        _log.critical(
            "Uncaught exception:",
            exc_info=(exc_type, exc_value, exc_traceback)
        )
    sys.__excepthook__(exc_type, exc_value, exc_traceback)
1077173
@Deprecated
    public static void logException(Logger log, Throwable throwable,
            String methodName, Object... params) {
        handleException(log, throwable, methodName, params);
    }
619768
def ExceptionHook(exctype, value, tb):
    '''
    

    '''

    for line in traceback.format_exception_only(exctype, value):
        log.error(line.replace('\n', ''))
    for line in traceback.format_tb(tb):
        log.error(line.replace('\n', ''))
    sys.__excepthook__(exctype, value, tb)
210008
protected void logException (final Throwable t, final String msg, final Object[] messageParams) {
		logger.error(msg, messageParams, t);
	}
614245
public void error(Object message, Throwable exception) {
        log(Level.SEVERE, String.valueOf(message), exception);
    }
604323
public void debug(String msg, Throwable e) {
        doLog(msg, LOG_DEBUG, null, e);
    }
1037632
def catch(ignore=[],
          was_doing="something important",
          helpfull_tips="you should use a debugger",
          gbc=None):
    
    exc_cls, exc, tb=sys.exc_info()
    if exc_cls in ignore:
        msg='exception in ignorelist'
        gbc.say('ignoring caught:'+str(exc_cls))
        return 'exception in ignorelist'
        

    ex_message = traceback.format_exception_only(exc_cls, exc)[-1]
    ex_message = ex_message.strip()
    
    # TODO: print(ex_message)

    error_frame = tb
    while error_frame.tb_next is not None:
        error_frame = error_frame.tb_next

    file = error_frame.tb_frame.f_code.co_filename
    line = error_frame.tb_lineno
    stack = traceback.extract_tb(tb)

    formated_stack = []
    for summary in stack:
        formated_stack.append({
            'file': summary[0],
            'line': summary[1],
            'func': summary[2],
            'text': summary[3]
        })

    event = {
        'was_doing':was_doing,
        'message': ex_message,
        'errorLocation': {
            'file': file,
            'line': line,
            'full': file + ' -> ' + str(line)
        },
        'stack': formated_stack
        #,
        #'time': time.time()
    }

    try:
        #logging.info('caught:'+pformat(event))
        gbc.cry('caught:'+pformat(event))
        print('Bubble3: written error to log')
        print('Bubble3: tips for fixing this:')
        print(helpfull_tips)

    except Exception as e:
        print('Bubble3: cant log error cause of %s' % e)
506871
def logdebug(logger, msg, *args, **kwargs):
    '''
    
    '''
    if esgfpid.defaults.LOG_DEBUG_TO_INFO:
        logger.info('DEBUG %s ' % msg, *args, **kwargs)
    else:
        logger.debug(msg, *args, **kwargs)
1318310
@Override
    public void debug(String msg) {
        if (logger.isLoggable(Level.FINE)) {
            log(SELF, Level.FINE, msg, null);
        }
    }
363513
@Override
    public void debug(String message, Throwable throwable) {
        if(this.logger.isDebugEnabled()) {
            this.logger.debug(buildMessage(message), throwable);
        }
    }
1039691
public static void logDebug(String message, Throwable t) {
		logDebug(message + SEP + getMessage(t));
	}
1275270
def _log_exception(self, exception):
        
        self._io.error(str(exception).strip().split(os.linesep))
808181
public static void logException(String message, Exception e) {
    logger.log(Level.SEVERE, message, e);
  }
149536
def exception_handler(self, pdb):
        '''
        

        '''

        # Grab the exception
        exctype, value, tb = sys.exc_info()

        # Log the error and create a .err file
        errfile = os.path.join(self.dir, self.name + '.err')
        with open(errfile, 'w') as f:
            for line in traceback.format_exception_only(exctype, value):
                ln = line.replace('\n', '')
                log.error(ln)
                print(ln, file=f)
            for line in traceback.format_tb(tb):
                ln = line.replace('\n', '')
                log.error(ln)
                print(ln, file=f)

        # Re-raise?
        if pdb:
            raise
894686
def exception(self, exception):
        """"""
        if self.writelog:
            self.logger.exception(exception)
        if self.verbose:
            for line in  traceback.format_exception(
                    None, exception, exception.__traceback__):
                print(line, end='', file=sys.stderr, flush=True)