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())
      else:
        message = self._AppLogsMessage(record)
        if isinstance(message, unicode):
          message = message.encode("UTF-8")


        logservice.write(message)
    except (KeyboardInterrupt, __HOLE__, runtime.DeadlineExceededError):
      raise
    except:
      self.handleError(record)
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/api/app_logging.py/AppLogsHandler.emit