当前位置: 首页>>代码示例>>Java>>正文


Java Priority.INFO_INT属性代码示例

本文整理汇总了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;
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:17,代码来源:EclipseLogAppender.java

示例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;
}
 
开发者ID:mongkoy,项目名称:c-logger,代码行数:27,代码来源:LogView4JLoggingEvent.java

示例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;
}
 
开发者ID:mongkoy,项目名称:c-logger,代码行数:27,代码来源:LogView4JLoggingEvent.java

示例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;
		}
	}
}
 
开发者ID:mongkoy,项目名称:c-logger,代码行数:26,代码来源:LogView4JLoggingEvent.java

示例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;
    }
}
 
开发者ID:eBay,项目名称:restcommander,代码行数:20,代码来源:ANSIConsoleAppender.java

示例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;
}
 
开发者ID:fjakop,项目名称:ngcalsync,代码行数:24,代码来源:Log4JSwingAppender.java

示例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);
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:29,代码来源:OBLogAppender.java

示例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";
}
 
开发者ID:huihoo,项目名称:olat,代码行数:13,代码来源:LogNumberPatternConverter.java

示例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";
}
 
开发者ID:huihoo,项目名称:olat,代码行数:14,代码来源:LogNumberPatternConverter.java

示例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;
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:37,代码来源:DebugOnlyLog4JToOpenfireAppender.java

示例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;
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:37,代码来源:Log4JToOpenfireAppender.java

示例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;
	}
}
 
开发者ID:Twain69,项目名称:jpostgrey,代码行数:27,代码来源:InputThread.java

示例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;
	}
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:37,代码来源:DebugOnlyLog4JToOpenfireAppender.java

示例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;
	}
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:37,代码来源:Log4JToOpenfireAppender.java


注:本文中的org.apache.log4j.Priority.INFO_INT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。