Java Code Examples for org.apache.log4j.Priority#WARN_INT

The following examples show how to use org.apache.log4j.Priority#WARN_INT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EclipseLogAppender.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
private int mapLevel(Level level) {
	switch (level.toInt()) {
	case Priority.DEBUG_INT:
	case Priority.INFO_INT:
		return IStatus.INFO;

	case Priority.WARN_INT:
		return IStatus.WARNING;

	case Priority.ERROR_INT:
	case Priority.FATAL_INT:
		return IStatus.ERROR;

	default:
		return IStatus.INFO;
	}
}
 
Example 2
Source File: EclipseLogAppender.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
private int mapLevel(Level level) {
	switch (level.toInt()) {
		case Priority.DEBUG_INT:
		case Priority.INFO_INT:
			return IStatus.INFO;

		case Priority.WARN_INT:
			return IStatus.WARNING;

		case Priority.ERROR_INT:
		case Priority.FATAL_INT:
			return IStatus.ERROR;

		default:
			return IStatus.INFO;
	}
}
 
Example 3
Source File: ANSIConsoleAppender.java    From restcommander with Apache License 2.0 6 votes vote down vote up
/**
 * Get the appropriate control characters to change
 * the colour for the specified logging level.
 */
private String getColour(org.apache.log4j.Level level) {
    switch (level.toInt()) {
        case Priority.FATAL_INT:
            return FATAL_COLOUR;
        case Priority.ERROR_INT:
            return ERROR_COLOUR;
        case Priority.WARN_INT:
            return WARN_COLOUR;
        case Priority.INFO_INT:
            return INFO_COLOUR;
        case Priority.DEBUG_INT:
            return DEBUG_COLOUR;
        default:
            return TRACE_COLOUR;
    }
}
 
Example 4
Source File: InternalXtextLogger.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
protected void forcedLog(String fqcn, Priority level, Object message, Throwable exception) {
	switch (level.toInt()) {
	case Priority.OFF_INT:
		break;
	case Priority.FATAL_INT:
	case Priority.ERROR_INT:
		if (exception != null) {
			this.logger.log(Level.SEVERE, Objects.toString(message), exception);
		} else {
			this.logger.severe(Objects.toString(message));
		}
		break;
	case Priority.WARN_INT:
		if (exception != null) {
			this.logger.log(Level.WARNING, Objects.toString(message), exception);
		} else {
			this.logger.warning(Objects.toString(message));
		}
		break;
	case Priority.ALL_INT:
	case Priority.INFO_INT:
	case Priority.DEBUG_INT:
	default:
		if (exception != null) {
			this.logger.log(Level.FINEST, Objects.toString(message), exception);
		} else {
			this.logger.finest(Objects.toString(message));
		}
		break;
	}
}
 
Example 5
Source File: LogNumberPatternConverter.java    From olat with Apache License 2.0 5 votes vote down vote up
public String convert(LoggingEvent event) {
    if (event.getLevel().toInt() == Priority.ERROR_INT) {
        return "N" + Tracing.nodeId + "-E" + String.valueOf(errorCounter.incrementAndGet());
    } else if (event.getLevel().toInt() == Priority.WARN_INT) {
        return "N" + Tracing.nodeId + "-W" + String.valueOf(warnCounter.incrementAndGet());
    } else if (event.getLevel().toInt() == Priority.INFO_INT) {
        return "N" + Tracing.nodeId + "-I" + String.valueOf(infoCounter.incrementAndGet());
    } else if (event.getLevel().toInt() == Priority.DEBUG_INT) {
        return "N" + Tracing.nodeId + "-D" + String.valueOf(debugCounter.incrementAndGet());
    }

    return "n/a";
}
 
Example 6
Source File: LogNumberPatternConverter.java    From olat with Apache License 2.0 5 votes vote down vote up
@Override
public String convert(LoggingEvent event) {
    if (event.getLevel().toInt() == Priority.ERROR_INT) {
        return "N" + Tracing.nodeId + "-E" + String.valueOf(errorCounter.incrementAndGet());
    } else if (event.getLevel().toInt() == Priority.WARN_INT) {
        return "N" + Tracing.nodeId + "-W" + String.valueOf(warnCounter.incrementAndGet());
    } else if (event.getLevel().toInt() == Priority.INFO_INT) {
        return "N" + Tracing.nodeId + "-I" + String.valueOf(infoCounter.incrementAndGet());
    } else if (event.getLevel().toInt() == Priority.DEBUG_INT) {
        return "N" + Tracing.nodeId + "-D" + String.valueOf(debugCounter.incrementAndGet());
    }

    return "n/a";
}
 
Example 7
Source File: EclipseLogAppender.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
private boolean isDoLog(Level level) {
	return level.toInt() >= Priority.WARN_INT;
}
 
Example 8
Source File: EclipseLogAppender.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
private boolean isDoLog(Level level) {
	return level.toInt() >= Priority.WARN_INT;
}