dry things up a little

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@1591973 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Bodewig 2014-05-02 16:59:56 +00:00
parent 791b182df0
commit 28abce3b1f
1 changed files with 9 additions and 5 deletions

View File

@ -120,19 +120,23 @@ public class LogCapturer implements BuildListener {
*/
public void messageLogged(BuildEvent event) {
if (event.getPriority() <= Project.MSG_ERR) {
err.append(event.getMessage()).append(StringUtils.LINE_SEP);
append(err, event);
}
if (event.getPriority() <= Project.MSG_WARN) {
warn.append(event.getMessage()).append(StringUtils.LINE_SEP);
append(warn, event);
}
if (event.getPriority() <= Project.MSG_INFO) {
info.append(event.getMessage()).append(StringUtils.LINE_SEP);
append(info, event);
}
if (event.getPriority() <= Project.MSG_VERBOSE) {
verbose.append(event.getMessage()).append(StringUtils.LINE_SEP);
append(verbose, event);
}
if (event.getPriority() <= Project.MSG_DEBUG) {
debug.append(event.getMessage()).append(StringUtils.LINE_SEP);
append(debug, event);
}
}
private static void append(StringBuffer sb, BuildEvent event) {
sb.append(event.getMessage()).append(StringUtils.LINE_SEP);
}
}