Java Code Examples for org.apache.velocity.runtime.log.LogChute#WARN_ID

The following examples show how to use org.apache.velocity.runtime.log.LogChute#WARN_ID . 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: SLF4JLogChute.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * @see LogChute#isLevelEnabled(int)
 */
public boolean isLevelEnabled(int level) {
    switch (level) {
        case LogChute.DEBUG_ID:
            return log.isDebugEnabled();
        case LogChute.INFO_ID:
            return log.isInfoEnabled();
        case LogChute.TRACE_ID:
            return log.isTraceEnabled();
        case LogChute.WARN_ID:
            return log.isWarnEnabled();
        case LogChute.ERROR_ID:
            return log.isErrorEnabled();
        default:
            return true;
    }
}
 
Example 2
Source File: SLF4JLogChute.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * @see LogChute#isLevelEnabled(int)
 */
public boolean isLevelEnabled(int level) {
    switch (level) {
        case LogChute.DEBUG_ID:
            return log.isDebugEnabled();
        case LogChute.INFO_ID:
            return log.isInfoEnabled();
        case LogChute.TRACE_ID:
            return log.isTraceEnabled();
        case LogChute.WARN_ID:
            return log.isWarnEnabled();
        case LogChute.ERROR_ID:
            return log.isErrorEnabled();
        default:
            return true;
    }
}
 
Example 3
Source File: SLF4JLogChute.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * @see LogChute#log(int, String, Throwable)
 */
public void log(int level, String message, Throwable t) {
    switch (level) {
        case LogChute.WARN_ID:
            log.warn(message, t);
            break;
        case LogChute.INFO_ID:
            log.info(message, t);
            break;
        case LogChute.TRACE_ID:
            log.trace(message, t);
            break;
        case LogChute.ERROR_ID:
            log.error(message, t);
            break;
        case LogChute.DEBUG_ID:
        default:
            log.debug(message, t);
            break;
    }
}
 
Example 4
Source File: SLF4JLogChute.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * @see LogChute#log(int, String)
 */
public void log(int level, String message) {
    switch (level) {
        case LogChute.WARN_ID:
            log.warn(message);
            break;
        case LogChute.INFO_ID:
            log.info(message);
            break;
        case LogChute.TRACE_ID:
            log.trace(message);
            break;
        case LogChute.ERROR_ID:
            log.error(message);
            break;
        case LogChute.DEBUG_ID:
        default:
            log.debug(message);
            break;
    }
}
 
Example 5
Source File: Slf4jLogChute.java    From minnal with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether the specified log level is enabled.
 */
public boolean isLevelEnabled(int level)
{
    switch (level)
    {
        case LogChute.DEBUG_ID:
            return log.isDebugEnabled();
        case LogChute.INFO_ID:
            return log.isInfoEnabled();
        case LogChute.TRACE_ID:
            return log.isTraceEnabled();
        case LogChute.WARN_ID:
            return log.isWarnEnabled();
        case LogChute.ERROR_ID:
            return log.isErrorEnabled();
        default:
            return true;
    }
}
 
Example 6
Source File: Slf4jLogChute.java    From minnal with Apache License 2.0 6 votes vote down vote up
/**
 * Send a log message from Velocity.
 */
public void log(int level, String message)
{
    switch (level)
    {
        case LogChute.WARN_ID:
            log.warn(message);
            break;
        case LogChute.INFO_ID:
            log.info(message);
            break;
        case LogChute.TRACE_ID:
            log.trace(message);
            break;
        case LogChute.ERROR_ID:
            log.error(message);
            break;
        case LogChute.DEBUG_ID:
        default:
            log.debug(message);
            break;
    }
}
 
Example 7
Source File: CustomTitle.java    From openemm with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Collect possible warnings and errors to own buffer
 * 
 * @param logLevel   the loglevel of the provided message
 * @param logMessage the message to log itself
 */
@Override
public void log (int logLevel, String logMessage) {
	if (logTo != null) {
		String	label;

		if (logLevel == LogChute.WARN_ID) {
			label = "WARNING";
		} else if (logLevel == LogChute.ERROR_ID) {
			label = "ERROR";
		} else {
			label = null;
		}
		if (label != null) {
			logTo.append ("[" + label + "]: " + logMessage + "\n");
		}
	}
}
 
Example 8
Source File: SLF4JLogChute.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * @see LogChute#log(int, String, Throwable)
 */
public void log(int level, String message, Throwable t) {
    switch (level) {
        case LogChute.WARN_ID:
            log.warn(message, t);
            break;
        case LogChute.INFO_ID:
            log.info(message, t);
            break;
        case LogChute.TRACE_ID:
            log.trace(message, t);
            break;
        case LogChute.ERROR_ID:
            log.error(message, t);
            break;
        case LogChute.DEBUG_ID:
        default:
            log.debug(message, t);
            break;
    }
}
 
Example 9
Source File: VelocityLogChute.java    From watcher with Apache License 2.0 6 votes vote down vote up
@Override
public boolean isLevelEnabled(int level) {
    switch (level) {
        case LogChute.DEBUG_ID:
            return logger.isDebugEnabled();
        case LogChute.INFO_ID:
            return logger.isInfoEnabled();
        case LogChute.TRACE_ID:
            return logger.isTraceEnabled();
        case LogChute.WARN_ID:
            return logger.isWarnEnabled();
        case LogChute.ERROR_ID:
            return logger.isErrorEnabled();
        default:
            return true;
    }
}
 
Example 10
Source File: VelocityLogChute.java    From watcher with Apache License 2.0 6 votes vote down vote up
@Override
public void log(int level, String message, Throwable t) {
    switch (level) {
        case LogChute.WARN_ID:
            logger.warn(message, t);
            break;
        case LogChute.INFO_ID:
            logger.info(message, t);
            break;
        case LogChute.TRACE_ID:
            logger.trace(message, t);
            break;
        case LogChute.ERROR_ID:
            logger.error(message, t);
            break;
        case LogChute.DEBUG_ID:
        default:
            logger.debug(message, t);
            break;
    }
}
 
Example 11
Source File: Slf4jLogChute.java    From minnal with Apache License 2.0 6 votes vote down vote up
/**
 * Send a log message from Velocity with an error.
 */
public void log(int level, String message, Throwable t)
{
    switch (level)
    {
        case LogChute.WARN_ID:
            log.warn(message, t);
            break;
        case LogChute.INFO_ID:
            log.info(message, t);
            break;
        case LogChute.TRACE_ID:
            log.trace(message, t);
            break;
        case LogChute.ERROR_ID:
            log.error(message, t);
            break;
        case LogChute.DEBUG_ID:
        default:
            log.debug(message, t);
            break;
    }
}
 
Example 12
Source File: VelocitySlf4JLogSystem.java    From feeyo-hlsserver with Apache License 2.0 6 votes vote down vote up
@Override
public boolean isLevelEnabled(int level) {
    switch (level) {
        case LogChute.DEBUG_ID:
            return LOGGER.isDebugEnabled();
        case LogChute.INFO_ID:
            return LOGGER.isInfoEnabled();
        case LogChute.TRACE_ID:
            return LOGGER.isTraceEnabled();
        case LogChute.WARN_ID:
            return LOGGER.isWarnEnabled();
        case LogChute.ERROR_ID:
            return LOGGER.isErrorEnabled();
        default:
            return true;
    }
}
 
Example 13
Source File: VelocitySlf4JLogSystem.java    From feeyo-hlsserver with Apache License 2.0 6 votes vote down vote up
@Override
public void log(int level, String message, Throwable t) {
    switch (level) {
        case LogChute.WARN_ID:
            LOGGER.warn(message, t);
            break;
        case LogChute.INFO_ID:
            LOGGER.info(message, t);
            break;
        case LogChute.TRACE_ID:
            LOGGER.warn(message, t);
            break;
        case LogChute.ERROR_ID:
            LOGGER.error(message, t);
            break;
        case LogChute.DEBUG_ID:
        default:
            LOGGER.debug(message, t);
            break;
    }
}
 
Example 14
Source File: VelocitySlf4JLogSystem.java    From feeyo-hlsserver with Apache License 2.0 6 votes vote down vote up
@Override
public void log(int level, String message) {
    switch (level) {
        case LogChute.WARN_ID:
            LOGGER.warn(message);
            break;
        case LogChute.INFO_ID:
            LOGGER.info(message);
            break;
        case LogChute.TRACE_ID:
            LOGGER.trace(message);
            break;
        case LogChute.ERROR_ID:
            LOGGER.error(message);
            break;
        case LogChute.DEBUG_ID:
        default:
            LOGGER.debug(message);
            break;
    }
}
 
Example 15
Source File: MojoLogChute.java    From appbundle-maven-plugin with Apache License 2.0 5 votes vote down vote up
public void log(int i, String string, Throwable thrwbl) {
    switch(i) {
        case LogChute.TRACE_ID: mojo.getLog().debug(string, thrwbl); break;
        case LogChute.DEBUG_ID: mojo.getLog().debug(string, thrwbl); break;
        case LogChute.INFO_ID: mojo.getLog().info(string, thrwbl); break;
        case LogChute.WARN_ID: mojo.getLog().warn(string, thrwbl); break;
        case LogChute.ERROR_ID: mojo.getLog().error(string, thrwbl); break;
        default: mojo.getLog().debug(string, thrwbl);
    }
}
 
Example 16
Source File: StringExpander.java    From jsqsh with Apache License 2.0 5 votes vote down vote up
/**
 * Used to log a message.
 */
@Override
public void log (int level, String message) {

    if (level >= LogChute.WARN_ID) {
        
        System.err.println(logPrefix(level)
            + ": Failed while performing variable expansion processing: "
            + message);
    }
}
 
Example 17
Source File: StringExpander.java    From jsqsh with Apache License 2.0 5 votes vote down vote up
private String logPrefix(int level) {
    
    switch (level) {
        
        case LogChute.TRACE_ID: return "TRACE";
        case LogChute.DEBUG_ID: return "DEBUG";
        case LogChute.INFO_ID: return "INOF";
        case LogChute.WARN_ID: return "WARN";
        case LogChute.ERROR_ID: return "ERROR";
        default:
            return "UNKNOWN";
    }
}
 
Example 18
Source File: ExtensionManager.java    From jsqsh with Apache License 2.0 2 votes vote down vote up
/**
 * Used by LogChute to determine if a logging level is current
 * enabled.
 * 
 * @param level The level we are testing.
 */
@Override
public boolean isLevelEnabled (int level) {
    
    return (level >= LogChute.WARN_ID);
}
 
Example 19
Source File: StringExpander.java    From jsqsh with Apache License 2.0 2 votes vote down vote up
/**
 * Used by LogChute to determine if a logging level is current
 * enabled.
 * 
 * @param level The level we are testing.
 */
@Override
public boolean isLevelEnabled (int level) {
    
    return (level >= LogChute.WARN_ID);
}
 
Example 20
Source File: CustomTitle.java    From openemm with GNU Affero General Public License v3.0 2 votes vote down vote up
/**
 * Tell the runtime system to just log warnings and errors
 *
 * @param level the level to check if it is enabled
 * @return      true, for warning and error levels, false otherwise
 */
@Override
public boolean isLevelEnabled (int level) {
	return (level == LogChute.WARN_ID) || (level == LogChute.ERROR_ID);
}