Java Code Examples for org.apache.tools.ant.BuildEvent#getException()

The following examples show how to use org.apache.tools.ant.BuildEvent#getException() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AntLoggingAdapter.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void messageLogged(BuildEvent event) {
    final StringBuffer message = new StringBuffer();
    if (event.getTask() != null) {
        String taskName = event.getTask().getTaskName();
        message.append("[ant:").append(taskName).append("] ");
    }
    final String messageText = event.getMessage();
    message.append(messageText);

    LogLevel level = Logging.ANT_IVY_2_SLF4J_LEVEL_MAPPER.get(event.getPriority());

    if (event.getException() != null) {
        logger.log(level, message.toString(), event.getException());
    } else {
        logger.log(level, message.toString());
    }
}
 
Example 2
Source File: AntLoggingAdapter.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void messageLogged(BuildEvent event) {
    final StringBuffer message = new StringBuffer();
    if (event.getTask() != null) {
        String taskName = event.getTask().getTaskName();
        message.append("[ant:").append(taskName).append("] ");
    }
    final String messageText = event.getMessage();
    message.append(messageText);

    LogLevel level = Logging.ANT_IVY_2_SLF4J_LEVEL_MAPPER.get(event.getPriority());

    if (event.getException() != null) {
        logger.log(level, message.toString(), event.getException());
    } else {
        logger.log(level, message.toString());
    }
}
 
Example 3
Source File: AntLoggingAdapter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void messageLogged(BuildEvent event) {
    final StringBuffer message = new StringBuffer();
    if (event.getTask() != null) {
        String taskName = event.getTask().getTaskName();
        message.append("[ant:").append(taskName).append("] ");
    }
    final String messageText = event.getMessage();
    message.append(messageText);

    LogLevel level = Logging.ANT_IVY_2_SLF4J_LEVEL_MAPPER.get(event.getPriority());

    if (event.getException() != null) {
        logger.log(level, message.toString(), event.getException());
    } else {
        logger.log(level, message.toString());
    }
}
 
Example 4
Source File: AntLoggingAdapter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void messageLogged(BuildEvent event) {
    final StringBuffer message = new StringBuffer();
    if (event.getTask() != null) {
        String taskName = event.getTask().getTaskName();
        message.append("[ant:").append(taskName).append("] ");
    }
    final String messageText = event.getMessage();
    message.append(messageText);

    LogLevel level = Logging.ANT_IVY_2_SLF4J_LEVEL_MAPPER.get(event.getPriority());

    if (event.getException() != null) {
        logger.log(level, message.toString(), event.getException());
    } else {
        logger.log(level, message.toString());
    }
}
 
Example 5
Source File: NbBuildLogger.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
    }
}
 
Example 6
Source File: NameBearerHandle.java    From gate-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Set status message appropriately when task completes or fails.
 */
@Override
public void taskFinished(BuildEvent buildEvent) {
  if(buildEvent.getException() != null) {
    statusChanged("Error exporting application");
  }
  else {
    statusChanged("Export complete");
  }
}
 
Example 7
Source File: LangtoolsIdeaAntLogger.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void taskFinished(BuildEvent event) {
    if (tasks.peek() == Task.ROOT) {
        //we need to 'close' the root task to get nicer output
        logger.taskFinished(event);
    } else if (!suppressTaskFailures && event.getException() != null) {
        //the first (innermost) task failure should always be logged
        event.setMessage(event.getException().toString(), 0);
        event.setException(null);
        //note: we turn this into a plain message to avoid stack trace being logged by Idea
        logger.messageLogged(event);
        suppressTaskFailures = true;
    }
    tasks.pop();
}
 
Example 8
Source File: JdkIdeaAntLogger.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void taskFinished(BuildEvent event) {
    if (tasks.peek() == Task.ROOT) {
        //we need to 'close' the root task to get nicer output
        logger.taskFinished(event);
    } else if (!suppressTaskFailures && event.getException() != null) {
        //the first (innermost) task failure should always be logged
        event.setMessage(event.getException().toString(), 0);
        event.setException(null);
        //note: we turn this into a plain message to avoid stack trace being logged by Idea
        logger.messageLogged(event);
        suppressTaskFailures = true;
    }
    tasks.pop();
}