コード例 #1
0
  private void handleLog(ShellMsg shellMsg) {
    String msg = shellMsg.getMsg();
    msg = "ShellLog " + _process.getProcessInfoString() + " " + msg;
    ShellMsg.ShellLogLevel logLevel = shellMsg.getLogLevel();

    switch (logLevel) {
      case TRACE:
        LOG.trace(msg);
        break;
      case DEBUG:
        LOG.debug(msg);
        break;
      case INFO:
        LOG.info(msg);
        break;
      case WARN:
        LOG.warn(msg);
        break;
      case ERROR:
        LOG.error(msg);
        _collector.reportError(new ReportedFailedException(msg));
        break;
      default:
        LOG.info(msg);
        break;
    }
  }
コード例 #2
0
 protected void die(ShellBoltException exception) {
   String processInfo =
       _process.getProcessInfoString() + _process.getProcessTerminationInfoString();
   _exception = new RuntimeException(processInfo, exception);
   LOG.error("Halting process: ShellBolt died.", _exception);
   _collector.reportError(_exception);
   if (_running
       || (exception.getCause()
           instanceof Error)) { // don't exit if not running, unless it is an Error
     Runtime.getRuntime().halt(11);
   }
 }