Throws an error based on the information that the logger reported,
        given the logging level.
        
        :param      record: <logging.LogRecord>
497530
def emit(self, record):
        
        if not logging.raiseExceptions:
            return

        logger = logging.getLogger(record.name)

        # raise an exception based on the error logging
        if logger.level <= record.levelno:
            err = record.msg[0]
            if not isinstance(err, Exception):
                err = ProjexError(nstr(record.msg))

            # log the traceback info
            data = record.__dict__.copy()
            data['type'] = type(err).__name__
            msg = ERROR_MESSAGE % data
            sys.stderr.write(msg)
            raise err
1284781
async def handle(self, record: LogRecord) -> bool:  # type: ignore
        
        rv = self.filter(record)
        if rv:
            await self.emit(record)
        return rv
99302
public void error(Throwable error, String description) {
    log(error, null, description, Level.ERROR);
  }
711734
def log_error(self, msg, *args):
        """"""
        if self._logger is not None:
            self._logger.error(msg, *args)
        else:
            print(msg % args)
1173729
static function record($message,$level=self::ERR,$record=false) {
        if($record || false !== strpos(C('LOG_LEVEL'),$level)) {
            self::$log[] =   "{$level}: {$message}\r\n";
        }
    }
267677
def _update_log_record(self, record):
    
    if not hasattr(record, 'hostname'):
        record.hostname = '-'
    if not hasattr(record, 'job_id'):
        record.job_id = self.job_id
807677
void log(LogRecord record, boolean wasForced) {
    // Do the fast boolean check (which normally succeeds) before calling isLoggable().
    if (!wasForced || logger.isLoggable(record.getLevel())) {
      // Unforced log statements or forced log statements at or above the logger's level can be
      // passed to the normal log(LogRecord) method.
      logger.log(record);
    } else {
      // If logging has been forced for a log record which would otherwise be discarded, we cannot
      // call our logger's log(LogRecord) method, so we must simulate its behavior in one of two
      // ways.
      // 1: Simulate the effect of calling the log(LogRecord) method directly (this is safe if the
      //    logger provided by the log manager was a normal Logger instance).
      // 2: Obtain a "child" logger from the log manager which is set to log everything, and call
      //    its log(LogRecord) method instead (which should have the same overridden behavior and
      //    will still publish log records to our logger's handlers).
      //
      // In all cases we still call the filter (if one exists) even though we ignore the result.
      // Use a local variable to avoid race conditions where the filter can be unset at any time.
      Filter filter = logger.getFilter();
      if (filter != null) {
        filter.isLoggable(record);
      }
      if (logger.getClass() == Logger.class || cannotUseForcingLogger) {
        // If the Logger instance is not a subclass, its log(LogRecord) method cannot have been
        // overridden. That means it's safe to just publish the log record directly to handlers
        // to avoid the loggability check, which would otherwise discard the forced log record.
        publish(logger, record);
      } else {
        // Hopefully rare situation in which the logger is subclassed _and_ the log record would
        // normally be discarded based on its level.
        forceLoggingViaChildLogger(record);
      }
    }
  }
83016
public void logError(Object[] message,Throwable throwable)
    {
        this.log(LogLevel.ERROR,message,throwable);
    }
226189
public function log(\Imi\Log\Record $record)
    {
        if(in_array($record->getLevel(), $this->levels))
        {
            $this->records[] = $record;
            $this->trySave();
        }
    }
1262273
def emit(self, record):
        
        try:
            # Check logging.LogRecord properties for lots of other goodies
            # like line number etc. you can get from the log message.
            QgsMessageLog.logMessage(record.getMessage(), 'InaSAFE', 0)
        except MemoryError:
            message = tr(
                'Due to memory limitations on this machine, InaSAFE can not '
                'handle the full log')
            print(message)
            QgsMessageLog.logMessage(message, 'InaSAFE', 0)
1215896
def handle_logging(self):
        

        configure_logging(self.get_scrapy_options())

        # Disable duplicates
        self.__scrapy_options["LOG_ENABLED"] = False

        # Now, after log-level is correctly set, lets log them.
        for msg in self.log_output:
            if msg["level"] is "error":
                self.log.error(msg["msg"])
            elif msg["level"] is "info":
                self.log.info(msg["msg"])
            elif msg["level"] is "debug":
                self.log.debug(msg["msg"])
160610
def format(self, record: logging.LogRecord) -> str:
        
        msg: Union[str, dict] = record.msg
        if not isinstance(record.msg, dict):
            msg = {self.default_msg_fieldname: msg}

        if record.exc_info:  # type: ignore
            msg["exc_info"] = record.exc_info
        if record.exc_text:  # type: ignore
            msg["exc_text"] = record.exc_text  # type: ignore

        return self.serializer(msg, default=self._default_handler)
864287
def error(self, message):
        
        if Settings.ErrorLogs:
            self._write_log("error", Settings.LogTime, message)
651952
def setRecord(self, record):
        
        self._record = record
        if record is not None:
            self.loadValues(record.recordValues(autoInflate=True))
        else:
            self.loadValues({})
4201
def _on_process_error(self, error):
        
        if self is None:
            return
        if error not in PROCESS_ERROR_STRING:
            error = -1
        if not self._prevent_logs:
            _logger().warning(PROCESS_ERROR_STRING[error])
1004173
def emit(
            self,
            record):
        

        self.debug_log('emit')

        try:
            record = self.format_record(
                record)
        except Exception as e:
            self.write_log(
                'Exception in Splunk logging handler={}'.format(e))
            self.write_log(
                traceback.format_exc())
            return

        if self.sleep_interval > 0:
            try:
                self.debug_log('put in queue')
                # Put log message into queue; worker thread will pick up
                self.queue.put_nowait(
                    record)
            except Exception as e:
                self.write_log(
                    'log queue full - log data will be dropped.')
        else:
            # Flush log immediately; is blocking call
            self.publish_to_splunk(
                payload=record)
876053
public void logError(final Level level, final String message, final Error e)
	{
		try {
			Logger errors = LoggingFactory
					.getLogger(LoggingFactory.NAME_ERROR_LOGGER);

			errors.logThrowable(level, message, e);

		}
		catch (LoggingException ex) {
			ex.printStackTrace();
		}

		if (logLevel.toInt() > level.toInt()) {
			return;
		}

		logThrowable(level, message, e);
	}