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


Java BuildEvent.getPriority方法代码示例

本文整理汇总了Java中org.apache.tools.ant.BuildEvent.getPriority方法的典型用法代码示例。如果您正苦于以下问题:Java BuildEvent.getPriority方法的具体用法?Java BuildEvent.getPriority怎么用?Java BuildEvent.getPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.BuildEvent的用法示例。


在下文中一共展示了BuildEvent.getPriority方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public synchronized void messageLogged(BuildEvent event) {
    final boolean failOnError = isFailOnError(event);
    if (sendException(event, failOnError)) {
        return;
    }

    int priority = event.getPriority();
    if (priority == Project.MSG_ERR && !failOnError) {
        // some ant tasks (like Copy) with 'failOnError' attribute set to 'false'
        // send warnings with priority level = Project.MSG_ERR
        // this heuristic corrects the priority level, so that IDEA considers the message not as an error but as a warning
        priority = Project.MSG_WARN;
    }

    final String message = event.getMessage();

    if (priority == Project.MSG_ERR) {
        myMessagePriority.sendMessage(ERROR, priority, message);
    } else {
        myMessagePriority.sendMessage(MESSAGE, priority, message);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:23,代码来源:HybrisIdeaAntLogger.java

示例2: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public synchronized void messageLogged(BuildEvent event) {
  final boolean failOnError = isFailOnError(event);
  if (sendException(event, failOnError)) {
    return;
  }

  int priority = event.getPriority();
  if (priority == Project.MSG_ERR && !failOnError) {
    // some ant tasks (like Copy) with 'failOnError' attribute set to 'false'
    // send warnings with priority level = Project.MSG_ERR
    // this heuristic corrects the priority level, so that IDEA considers the message not as an error but as a warning
    priority = Project.MSG_WARN;
  }

  final String message = event.getMessage();

  if (priority == Project.MSG_ERR) {
    myMessagePriority.sendMessage(ERROR, priority, message);
  }
  else {
    myMessagePriority.sendMessage(MESSAGE, priority, message);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:IdeaAntLogger2.java

示例3: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public synchronized void messageLogged(BuildEvent event)
{
	Throwable ex = event.getException();
	int level = event.getPriority();
	if (level <= Project.MSG_WARN || ex != null)
	{
		if (level == Project.MSG_ERR || ex != null)
		{
			this.out.append("Error:").appendln();
		}
		else
		{
			this.out.append("Warn:").appendln();
		}
		this.out.append(event.getMessage());
		if (ex != null)
		{
			this.out.appendln().append("Exception:").appendln();
			StringTool.appendStackTrace(ex, this.out);
		}
		this.out.appendln();
	}
}
 
开发者ID:micromagic,项目名称:eterna,代码行数:24,代码来源:AntCG.java

示例4: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * Fired whenever a message is logged.
 *
 * @see BuildEvent#getMessage()
 * @see BuildEvent#getPriority()
 */
public void messageLogged (final BuildEvent event)
{
  if (event.getPriority () > m_nLogLevel)
  {
    // ignore event
    return;
  }

  if (event.getPriority () == Project.MSG_INFO ||
      event.getPriority () == Project.MSG_WARN ||
      event.getPriority () == Project.MSG_ERR)
  {
    logBuffer.append (event.getMessage ()).append ('\n');
  }
  fullLogBuffer.append (event.getMessage ()).append ('\n');
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:23,代码来源:MyBuildFileRule.java

示例5: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void messageLogged (@Nonnull final BuildEvent aEvent)
{
  if (aEvent.getPriority () <= Project.MSG_ERR)
    s_aLogger.error (aEvent.getMessage (), aEvent.getException ());
  else
    if (aEvent.getPriority () <= Project.MSG_WARN)
      s_aLogger.warn (aEvent.getMessage (), aEvent.getException ());
    else
      if (aEvent.getPriority () <= Project.MSG_INFO)
        s_aLogger.info (aEvent.getMessage (), aEvent.getException ());
      else
      {
        // Switch this from "debug" to "info" to get more output
        if (m_bDebugMode)
          s_aLogger.info (aEvent.getMessage (), aEvent.getException ());
        else
          s_aLogger.debug (aEvent.getMessage (), aEvent.getException ());
      }
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:20,代码来源:LoggingBuildListener.java

示例6: Event

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * Create a new regular event.
 * @param e the Ant build event
 * @param msgLogged true for logged events
 */
public Event(BuildEvent e, boolean msgLogged) {
    this.e = e;
    exception = e.getException();
    if (msgLogged) {
        level = e.getPriority();
    } else {
        level = -1;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:NbBuildLogger.java

示例7: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * This is called for every log message (of any priority). If the
 * current process has been interrupted (the user pressed the stop
 * button) then we throw an exception to interrupt the currently
 * executing Ant task. Other than that, we simply pass INFO and
 * higher messages to the GATE status listener.
 */
@Override
public void messageLogged(BuildEvent buildEvent) {
  // check for interruption
  if(interrupted) {
    interrupted = false;
    throw new BuildException("Export interrupted");
  }
  if(buildEvent.getPriority() <= Project.MSG_INFO) {
    statusChanged(buildEvent.getMessage());
  }
  // log the message to log4j for debugging purposes
  log.debug(buildEvent.getPriority() + ": " + buildEvent.getMessage());
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:21,代码来源:NameBearerHandle.java

示例8: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
@Override
public void messageLogged(BuildEvent event) {
    String msg = event.getMessage();

    boolean processed = false;

    if (!tasks.isEmpty()) {
        Task task = tasks.peek();
        for (MessageKind messageKind : task.msgs) {
            if (messageKind.matches(msg)) {
                event.setMessage(msg, messageKind.priority);
                processed = true;
                if (messageKind == MessageKind.JAVAC_CRASH) {
                    crashFound = true;
                }
                break;
            }
        }
    }

    if (event.getPriority() == MSG_ERR || crashFound) {
        //we log errors regardless of owning task
        logger.messageLogged(event);
        suppressTaskFailures = true;
    } else if (processed) {
        logger.messageLogged(event);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:LangtoolsIdeaAntLogger.java

示例9: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void messageLogged(BuildEvent be) {
	if (be.getPriority() <= _logLevel) {
		String prefix = "";
		Task task = be.getTask();
		if (task != null) {
			String taskName = task.getTaskName();
			if (taskName != null) {
				prefix = padToLength(taskName) + " ";
			}
		}
		writeLog(prefix+be.getMessage());
	}
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:14,代码来源:PluginBuildListener.java

示例10: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void messageLogged( BuildEvent event )
{
	if( event.getPriority() == Project.MSG_INFO || event.getPriority() == Project.MSG_WARN || event.getPriority() == Project.MSG_ERR )
	{
		MyBuildFileTest.this.logBuffer.append( event.getMessage() );
		MyBuildFileTest.this.logBuffer.append( '\n' );
	}
}
 
开发者ID:sindicate,项目名称:solidbase,代码行数:9,代码来源:MyBuildFileTest.java

示例11: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
@Override
public void messageLogged(BuildEvent event) {
	if (proc != event.getSource())
		return;

	if (outputOut && event.getPriority() == Project.MSG_INFO)
		System.out.println(event.getMessage());
	else if (outputErr && event.getPriority() == Project.MSG_ERR)
		System.err.println(event.getMessage());
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:11,代码来源:JavaProcess.java

示例12: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * Fired whenever a message is logged.
 *
 * @param event
 *            BuildEvent
 * @see BuildEvent#getMessage()
 * @see BuildEvent#getPriority()
 */
public void messageLogged(BuildEvent event) {
    if (event.getPriority() > logLevel) {
        // ignore event
        return;
    }

    buildLog.append(event.getMessage());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:17,代码来源:AntTestListener.java

示例13: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * @see BuildListener#messageLogged
 * {@inheritDoc}.
 */
@Override
public void messageLogged(final BuildEvent event) {
    Object categoryObject = event.getTask();
    if (categoryObject == null) {
        categoryObject = event.getTarget();
        if (categoryObject == null) {
            categoryObject = event.getProject();
        }
    }

    final Logger log
        = Logger.getLogger(categoryObject.getClass().getName());
    switch (event.getPriority()) {
        case Project.MSG_ERR:
            log.error(event.getMessage());
            break;
        case Project.MSG_WARN:
            log.warn(event.getMessage());
            break;
        case Project.MSG_INFO:
            log.info(event.getMessage());
            break;
        case Project.MSG_VERBOSE:
            log.debug(event.getMessage());
            break;
        case Project.MSG_DEBUG:
            log.debug(event.getMessage());
            break;
        default:
            log.error(event.getMessage());
            break;
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:38,代码来源:Log4jListener.java

示例14: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * @see BuildListener#messageLogged
 * {@inheritDoc}.
 */
@Override
public void messageLogged(final BuildEvent event) {
    if (initialized) {
        Object categoryObject = event.getTask();
        String categoryString;
        String categoryDetail = null;

        if (categoryObject == null) {
            categoryObject = event.getTarget();
            if (categoryObject == null) {
                categoryString = PROJECT_LOG;
                categoryDetail = event.getProject().getName();
            } else {
                categoryString = TARGET_LOG;
                categoryDetail = event.getTarget().getName();
            }
        } else {
            // It's a task - append the target
            if (event.getTarget() != null) {
                categoryString = categoryObject.getClass().getName();
                categoryDetail = event.getTarget().getName();
            } else {
                categoryString = categoryObject.getClass().getName();
            }

        }

        final Log log = getLog(categoryString, categoryDetail);
        final int priority = event.getPriority();
        final String message = event.getMessage();
        realLog(log, message, priority, null);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:38,代码来源:CommonsLoggingListener.java

示例15: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * Fired whenever a message is logged.
 * 
 * @see BuildEvent#getMessage()
 * @see BuildEvent#getPriority()
 */
public void messageLogged(BuildEvent event) {
    if (event.getPriority() > logLevel) {
        // ignore event
        return;
    }

    buildLog.append(event.getMessage());
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:15,代码来源:AntTestListener.java


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