本文整理汇总了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);
}
}
示例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();
}
}
示例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');
}
示例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 ());
}
}
示例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;
}
}
示例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());
}
示例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);
}
}
示例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());
}
}
示例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' );
}
}
示例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());
}
示例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());
}
示例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;
}
}
示例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);
}
}
示例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());
}