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


Java Priority.OFF_INT属性代码示例

本文整理汇总了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);
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:29,代码来源:OBLogAppender.java

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

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

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

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

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


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