Browse Source

Echo no longer handles log messages - only useful for writing to files.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270433 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
13e99fc91b
2 changed files with 4 additions and 88 deletions
  1. +2
    -44
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Echo.java
  2. +2
    -44
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Echo.java

+ 2
- 44
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Echo.java View File

@@ -24,7 +24,6 @@ public class Echo
private String m_message = "";// required
private File m_file;
private boolean m_append;
private EchoLevel m_echoLevel;

/**
* Shall we append to an existing file?
@@ -46,26 +45,6 @@ public class Echo
m_file = file;
}

/**
* Set the logging level to one of
* <ul>
* <li> error</li>
* <li> warning</li>
* <li> info</li>
* <li> verbose</li>
* <li> debug</li>
* <ul><p>
*
* The default is &quot;warning&quot; to ensure that messages are
* displayed by default when using the -quiet command line option.</p>
*
* @param echoLevel The new Level value
*/
public void setLevel( final EchoLevel echoLevel )
{
m_echoLevel = echoLevel;
}

/**
* Sets the message variable.
*
@@ -84,7 +63,7 @@ public class Echo
public void addText( final String message )
throws TaskException
{
m_message += getProject().replaceProperties( message );
m_message = message;
}

/**
@@ -97,7 +76,7 @@ public class Echo
{
if( m_file == null )
{
doLog();
throw new TaskException( "Echo only used to write to files now !");
}
else
{
@@ -126,25 +105,4 @@ public class Echo
}
}
}

private void doLog()
{
final String option = m_echoLevel.getValue();
if( option.equals( "error" ) )
{
getLogger().error( m_message );
}
else if( option.equals( "warning" ) )
{
getLogger().warn( m_message );
}
else if( option.equals( "info" ) )
{
getLogger().info( m_message );
}
else
{
getLogger().debug( m_message );
}
}
}

+ 2
- 44
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Echo.java View File

@@ -24,7 +24,6 @@ public class Echo
private String m_message = "";// required
private File m_file;
private boolean m_append;
private EchoLevel m_echoLevel;

/**
* Shall we append to an existing file?
@@ -46,26 +45,6 @@ public class Echo
m_file = file;
}

/**
* Set the logging level to one of
* <ul>
* <li> error</li>
* <li> warning</li>
* <li> info</li>
* <li> verbose</li>
* <li> debug</li>
* <ul><p>
*
* The default is &quot;warning&quot; to ensure that messages are
* displayed by default when using the -quiet command line option.</p>
*
* @param echoLevel The new Level value
*/
public void setLevel( final EchoLevel echoLevel )
{
m_echoLevel = echoLevel;
}

/**
* Sets the message variable.
*
@@ -84,7 +63,7 @@ public class Echo
public void addText( final String message )
throws TaskException
{
m_message += getProject().replaceProperties( message );
m_message = message;
}

/**
@@ -97,7 +76,7 @@ public class Echo
{
if( m_file == null )
{
doLog();
throw new TaskException( "Echo only used to write to files now !");
}
else
{
@@ -126,25 +105,4 @@ public class Echo
}
}
}

private void doLog()
{
final String option = m_echoLevel.getValue();
if( option.equals( "error" ) )
{
getLogger().error( m_message );
}
else if( option.equals( "warning" ) )
{
getLogger().warn( m_message );
}
else if( option.equals( "info" ) )
{
getLogger().info( m_message );
}
else
{
getLogger().debug( m_message );
}
}
}

Loading…
Cancel
Save