ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16131] - not possible to suppress "BUILD SUCCESSFUL" message
Date Wed, 15 Jan 2003 20:25:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16131

not possible to suppress "BUILD SUCCESSFUL" message





------- Additional Comments From mccartney@mayaviz.com  2003-01-15 20:25 -------
Changing the "buildFinished" method in "org.apache.tools.ant.DefaultLogger" to 
the following fixes the issue.  If msgOutputLevel is "error" or "warning" 
(i.e., as with -quiet), the message is suppressed.  Otherwise, it will be 
printed normally.

    public void buildFinished(BuildEvent event) {
        Throwable error = event.getException();
        StringBuffer message = new StringBuffer();

        if (error == null) {
            if (msgOutputLevel > Project.MSG_WARN) {
                message.append(StringUtils.LINE_SEP);
                message.append("BUILD SUCCESSFUL");
            }
        } else {
            message.append(StringUtils.LINE_SEP);
            message.append("BUILD FAILED");
            message.append(StringUtils.LINE_SEP);

            if (Project.MSG_VERBOSE <= msgOutputLevel ||
                !(error instanceof BuildException)) {
                message.append(StringUtils.getStackTrace(error));
            } else {
                if (error instanceof BuildException) {
                    message.append(error.toString()).append(lSep);
                } else {
                    message.append(error.getMessage()).append(lSep);
                }
            }
        }
 
        if (msgOutputLevel > Project.MSG_WARN) {
            message.append(StringUtils.LINE_SEP);
            message.append("Total time: ");
            message.append(formatTime(System.currentTimeMillis() - startTime));
        }

        String msg = message.toString();
        if (error == null) {
          if (msg.length() > 0) {
              printMessage(msg, out, Project.MSG_VERBOSE);
          }
        } else {
            printMessage(msg, err, Project.MSG_ERR);
        }
        log(msg);
    }

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message