本文整理汇总了Java中org.apache.log4j.Priority.INFO_INT属性的典型用法代码示例。如果您正苦于以下问题:Java Priority.INFO_INT属性的具体用法?Java Priority.INFO_INT怎么用?Java Priority.INFO_INT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.log4j.Priority
的用法示例。
在下文中一共展示了Priority.INFO_INT属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapLevel
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;
}
}
示例2: getIconName
/**
* Extract a reference to the static icon name
* @param levelInt the int value of the level
* @return an icon name
*/
private String getIconName() {
switch (level) {
case Priority.DEBUG_INT: {
return ICONS[0];
}
case Priority.INFO_INT: {
return ICONS[1];
}
case Priority.WARN_INT: {
return ICONS[2];
}
case Priority.ERROR_INT: {
return ICONS[3];
}
case Priority.FATAL_INT: {
return ICONS[4];
}
}
return null;
}
示例3: getLevelString
/**
* Extract a reference to the static level strings
* @param levelInt the int value of the level
* @return a level string
*/
public String getLevelString() {
switch (level) {
case Priority.DEBUG_INT: {
return LEVELS[0];
}
case Priority.INFO_INT: {
return LEVELS[1];
}
case Priority.WARN_INT: {
return LEVELS[2];
}
case Priority.ERROR_INT: {
return LEVELS[3];
}
case Priority.FATAL_INT: {
return LEVELS[4];
}
}
return null;
}
示例4: getLevelFlag
/**
* Fecth a flag for the current level to enable quick determination in a set of level flags
* @return the level flag for this log events level
*/
public int getLevelFlag() {
switch (level) {
case Priority.DEBUG_INT: {
return LEVEL_DEBUG_FLAG;
}
case Priority.INFO_INT: {
return LEVEL_INFO_FLAG;
}
case Priority.WARN_INT: {
return LEVEL_WARN_FLAG;
}
case Priority.ERROR_INT: {
return LEVEL_ERROR_FLAG;
}
case Priority.FATAL_INT: {
return LEVEL_FATAL_FLAG;
}
default: {
return 0;
}
}
}
示例5: getColour
/**
* 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;
}
}
示例6: getAttributeSet
private AttributeSet getAttributeSet(final LoggingEvent event) {
final MutableAttributeSet attr = new SimpleAttributeSet();
switch (event.getLevel().toInt()) {
case Priority.DEBUG_INT:
StyleConstants.setForeground(attr, Color.gray);
break;
case Priority.INFO_INT:
StyleConstants.setForeground(attr, Color.black);
break;
case Priority.WARN_INT:
StyleConstants.setForeground(attr, Color.orange.darker());
break;
case Priority.ERROR_INT:
StyleConstants.setForeground(attr, Color.red);
break;
case Priority.FATAL_INT:
StyleConstants.setForeground(attr, Color.red.darker());
StyleConstants.setBold(attr, true);
break;
default:
StyleConstants.setForeground(attr, Color.black);
}
return attr;
}
示例7: 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);
}
示例8: convert
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";
}
示例9: convert
@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";
}
示例10: 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;
}
}
示例11: 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;
}
}
示例12: 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;
}
}
示例13: 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;
}
}
示例14: 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;
}
}