本文整理汇总了Java中org.apache.log4j.Priority.OFF_INT属性的典型用法代码示例。如果您正苦于以下问题:Java Priority.OFF_INT属性的具体用法?Java Priority.OFF_INT怎么用?Java Priority.OFF_INT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.log4j.Priority
的用法示例。
在下文中一共展示了Priority.OFF_INT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logToProject
private void logToProject(Priority prio, String msg) {
if (projectHolder.get() == null) {
return;
}
int projectLogLevel = -1;
switch (prio.toInt()) {
case Priority.DEBUG_INT:
projectLogLevel = Project.MSG_DEBUG;
break;
case Priority.ERROR_INT:
projectLogLevel = Project.MSG_ERR;
break;
case Priority.FATAL_INT:
projectLogLevel = Project.MSG_ERR;
break;
case Priority.INFO_INT:
projectLogLevel = Project.MSG_INFO;
break;
case Priority.OFF_INT:
projectLogLevel = Project.MSG_VERBOSE;
break;
case Priority.WARN_INT:
projectLogLevel = Project.MSG_WARN;
break;
default:
throw new IllegalArgumentException("Priority " + prio.toInt() + " unknown");
}
projectHolder.get().log(msg, projectLogLevel);
}
示例2: append
@Override
protected void append(LoggingEvent event)
{
final Level l = event.getLevel();
final String message = event.getMessage().toString();
Throwable throwable = null;
if (event.getThrowableInformation() != null)
{
throwable = event.getThrowableInformation().getThrowable();
}
switch (l.toInt())
{
case Priority.OFF_INT:
// Logging turned off - do nothing.
break;
case Priority.FATAL_INT:
case Priority.ERROR_INT:
Log.debug(message, throwable);
break;
case Priority.WARN_INT:
Log.debug(message, throwable);
break;
case Priority.INFO_INT:
Log.debug(message, throwable);
break;
default:
// DEBUG and below (trace, all)
Log.debug(message, throwable);
break;
}
}
示例3: append
@Override
protected void append(LoggingEvent event)
{
final Level l = event.getLevel();
final String message = (event.getMessage() != null ? event.getMessage().toString() : "");
Throwable throwable = null;
if (event.getThrowableInformation() != null)
{
throwable = event.getThrowableInformation().getThrowable();
}
switch (l.toInt())
{
case Priority.OFF_INT:
// Logging turned off - do nothing.
break;
case Priority.FATAL_INT:
case Priority.ERROR_INT:
Log.error(message, throwable);
break;
case Priority.WARN_INT:
Log.warn(message, throwable);
break;
case Priority.INFO_INT:
Log.info(message, throwable);
break;
default:
// DEBUG and below (trace, all)
Log.debug(message, throwable);
break;
}
}
示例4: log
private void log(int priority, String message) {
StringBuffer sb = new StringBuffer();
sb.append("[").append(uuid).append("] ").append(message);
message = sb.toString();
switch (priority) {
case Priority.ALL_INT:
LOG.fatal(message);
break;
case Priority.DEBUG_INT:
LOG.debug(message);
break;
case Priority.ERROR_INT:
LOG.error(message);
break;
case Priority.FATAL_INT:
LOG.fatal(message);
break;
case Priority.INFO_INT:
LOG.info(message);
break;
case Priority.OFF_INT:
break;
case Priority.WARN_INT:
LOG.warn(message);
break;
}
}
示例5: append
@Override
protected void append(LoggingEvent event)
{
final Level l = event.getLevel();
final String message = event.getMessage().toString();
Throwable throwable = null;
if (event.getThrowableInformation() != null)
{
throwable = event.getThrowableInformation().getThrowable();
}
switch (l.toInt())
{
case Priority.OFF_INT:
// Logging turned off - do nothing.
break;
case Priority.FATAL_INT:
case Priority.ERROR_INT:
Log.debug(message, throwable);
break;
case Priority.WARN_INT:
Log.debug(message, throwable);
break;
case Priority.INFO_INT:
Log.debug(message, throwable);
break;
default:
// DEBUG and below (trace, all)
Log.debug(message, throwable);
break;
}
}
示例6: append
@Override
protected void append(LoggingEvent event)
{
final Level l = event.getLevel();
final String message = (event.getMessage() != null ? event.getMessage().toString() : "");
Throwable throwable = null;
if (event.getThrowableInformation() != null)
{
throwable = event.getThrowableInformation().getThrowable();
}
switch (l.toInt())
{
case Priority.OFF_INT:
// Logging turned off - do nothing.
break;
case Priority.FATAL_INT:
case Priority.ERROR_INT:
Log.error(message, throwable);
break;
case Priority.WARN_INT:
Log.warn(message, throwable);
break;
case Priority.INFO_INT:
Log.info(message, throwable);
break;
default:
// DEBUG and below (trace, all)
Log.debug(message, throwable);
break;
}
}