Browse Source

OK..First thanks to Sam for fixing this w/o complaining.

It was probably not a very clever idea to remove the
lSep since it is probably used by user-written loggers.

To further shoot myself in the foot I noticed that
I was compiling a different Ant repository than the
in the one I was doing my changes...

NB:If I continue this way I promise to stay away
from code for a while and take some vacations.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270160 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
0d470a5730
3 changed files with 9 additions and 7 deletions
  1. +3
    -0
      src/main/org/apache/tools/ant/DefaultLogger.java
  2. +4
    -4
      src/main/org/apache/tools/ant/NoBannerLogger.java
  3. +2
    -3
      src/main/org/apache/tools/ant/listener/MailLogger.java

+ 3
- 0
src/main/org/apache/tools/ant/DefaultLogger.java View File

@@ -73,6 +73,9 @@ public class DefaultLogger implements BuildLogger {
protected int msgOutputLevel = Project.MSG_ERR; protected int msgOutputLevel = Project.MSG_ERR;
private long startTime = System.currentTimeMillis(); private long startTime = System.currentTimeMillis();


/** line separator */
protected final static String lSep = StringUtils.LINE_SEP;

protected boolean emacsMode = false; protected boolean emacsMode = false;


/** /**


+ 4
- 4
src/main/org/apache/tools/ant/NoBannerLogger.java View File

@@ -54,6 +54,8 @@


package org.apache.tools.ant; package org.apache.tools.ant;


import org.apache.tools.ant.util.StringUtils;

/** /**
* Extends DefaultLogger to strip out empty targets. * Extends DefaultLogger to strip out empty targets.
* *
@@ -61,8 +63,6 @@ package org.apache.tools.ant;
*/ */
public class NoBannerLogger extends DefaultLogger { public class NoBannerLogger extends DefaultLogger {


static private final String lSep = System.getProperty("line.separator");

protected String targetName; protected String targetName;


public void targetStarted(BuildEvent event) { public void targetStarted(BuildEvent event) {
@@ -76,13 +76,13 @@ public class NoBannerLogger extends DefaultLogger {
public void messageLogged(BuildEvent event) { public void messageLogged(BuildEvent event) {


if( event.getPriority() > msgOutputLevel || if( event.getPriority() > msgOutputLevel ||
null == event.getMessage() ||
null == event.getMessage() ||
"".equals( event.getMessage().trim() ) ) { "".equals( event.getMessage().trim() ) ) {
return; return;
} }


if( null != targetName ) { if( null != targetName ) {
out.println(lSep + targetName + ":");
out.println(StringUtils.LINE_SEP + targetName + ":");
targetName = null; targetName = null;
} }




+ 2
- 3
src/main/org/apache/tools/ant/listener/MailLogger.java View File

@@ -66,6 +66,7 @@ import java.util.StringTokenizer;
import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.DefaultLogger; import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.StringUtils;
import org.apache.tools.mail.MailMessage; import org.apache.tools.mail.MailMessage;


/** /**
@@ -102,8 +103,6 @@ public class MailLogger extends DefaultLogger {


private StringBuffer buffer = new StringBuffer(); private StringBuffer buffer = new StringBuffer();


static private final String lSep = System.getProperty("line.separator");

/** /**
* Sends an e-mail with the log results. * Sends an e-mail with the log results.
* *
@@ -179,7 +178,7 @@ public class MailLogger extends DefaultLogger {
*@param message *@param message
*/ */
protected void log(String message) { protected void log(String message) {
buffer.append(message + lSep);
buffer.append(message + StringUtils.LINE_SEP);
} }






Loading…
Cancel
Save