Search in sources :

Example 1 with ReportedFailedException

use of org.apache.storm.topology.ReportedFailedException in project storm by apache.

the class ShellBolt method handleLog.

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;
    }
}
Also used : ReportedFailedException(org.apache.storm.topology.ReportedFailedException) ShellMsg(org.apache.storm.multilang.ShellMsg)

Aggregations

ShellMsg (org.apache.storm.multilang.ShellMsg)1 ReportedFailedException (org.apache.storm.topology.ReportedFailedException)1