Пример #1
0
  def emit(self, record):
    """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit().

    Args:
      record: A Python logging.LogRecord object.
    """
    try:
      if features.IsEnabled("LogServiceWriteRecord"):
        logservice.write_record(self._AppLogsLevel(record.levelno),
                                record.created,
                                self.format(record),
                                self._AppLogsLocation(record))
      else:
        message = self._AppLogsMessage(record)
        if isinstance(message, unicode):
          message = message.encode("UTF-8")


        logservice.write(message)
    except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
      raise
    except:
      self.handleError(record)
Пример #2
0
    def emit(self, record):
        """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit()."""
        try:
            message = self._AppLogsMessage(record)
            if isinstance(message, unicode):
                message = message.encode("UTF-8")

            logservice.write(message)
        except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
            raise
        except:
            self.handleError(record)
Пример #3
0
    def emit(self, record):
        """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit()."""
        try:
            message = self._AppLogsMessage(record)
            if isinstance(message, unicode):
                message = message.encode("UTF-8")

            logservice.write(message)
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
Пример #4
0
    def emit(self, record):
        """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit()."""
        try:
            if features.IsEnabled("LogServiceWriteRecord"):
                logservice.write_record(self._AppLogsLevel(record.levelno),
                                        record.created, self.format(record))
            else:
                message = self._AppLogsMessage(record)
                logservice.write(message)
        except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
            raise
        except:
            self.handleError(record)
Пример #5
0
  def emit(self, record):
    """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit()."""
    try:
      if features.IsEnabled("LogServiceWriteRecord"):
        logservice.write_record(self._AppLogsLevel(record.levelno),
                                record.created,
                                self.format(record))
      else:
        message = self._AppLogsMessage(record)
        logservice.write(message)
    except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
      raise
    except:
      self.handleError(record)
Пример #6
0
    def emit(self, record):
        """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit()."""
        try:
            message = self._AppLogsMessage(record)
            if isinstance(message, unicode):
                message = message.encode("UTF-8")

            logservice.write(message)
        except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
            raise
        except:
            # AppScale
            # We currently do not call on the base handler because it leads to
            # a recursive call. Currently passing.
            pass
Пример #7
0
  def emit(self, record):
    """Emit a record.

    This implementation is based on the implementation of
    StreamHandler.emit()."""
    try:
      message = self._AppLogsMessage(record)
      if isinstance(message, unicode):
        message = message.encode("UTF-8")


      logservice.write(message)
    except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
      raise
    except:
      # AppScale
      # We currently do not call on the base handler because it leads to 
      # a recursive call. Currently passing.
      pass