Browse Source

Introduce a getMessageOutputLevel() method on BuildLogger to return the currently set message output level

master
Jaikiran Pai 2 years ago
parent
commit
65d3af7d55
6 changed files with 33 additions and 0 deletions
  1. +3
    -0
      WHATSNEW
  2. +10
    -0
      src/main/org/apache/tools/ant/BuildLogger.java
  3. +5
    -0
      src/main/org/apache/tools/ant/DefaultLogger.java
  4. +5
    -0
      src/main/org/apache/tools/ant/XmlLogger.java
  5. +5
    -0
      src/main/org/apache/tools/ant/listener/CommonsLoggingListener.java
  6. +5
    -0
      src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java

+ 3
- 0
WHATSNEW View File

@@ -68,6 +68,9 @@ Other changes:
attribute if it doesn't exist.
Bugzilla Report 66231

* org.apache.tools.ant.BuildLogger now has a new method getMessageOutputLevel()
which returns the currently set message output level.

Changes from Ant 1.10.11 TO Ant 1.10.12
=======================================



+ 10
- 0
src/main/org/apache/tools/ant/BuildLogger.java View File

@@ -46,6 +46,16 @@ public interface BuildLogger extends BuildListener {
*/
void setMessageOutputLevel(int level);


/**
* @return Returns the {@link #setMessageOutputLevel(int) currently set} message output level.
* The {@code default} implementation of this method returns {@code MSG_INFO}.
* @since 1.10.13
*/
default int getMessageOutputLevel() {
return Project.MSG_INFO;
}

/**
* Sets the output stream to which this logger is to send its output.
*


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

@@ -93,6 +93,11 @@ public class DefaultLogger implements BuildLogger {
this.msgOutputLevel = level;
}

@Override
public int getMessageOutputLevel() {
return this.msgOutputLevel;
}

/**
* Sets the output stream to which this logger is to send its output.
*


+ 5
- 0
src/main/org/apache/tools/ant/XmlLogger.java View File

@@ -432,6 +432,11 @@ public class XmlLogger implements BuildLogger {
msgOutputLevel = level;
}

@Override
public int getMessageOutputLevel() {
return this.msgOutputLevel;
}

/**
* Set the output stream to which logging output is sent when operating
* as a logger.


+ 5
- 0
src/main/org/apache/tools/ant/listener/CommonsLoggingListener.java View File

@@ -308,6 +308,11 @@ public class CommonsLoggingListener implements BuildListener, BuildLogger {
// Use the logger config
}

@Override
public int getMessageOutputLevel() {
return Project.MSG_INFO;
}

/**
* Set the output print stream.
* @param output the output stream


+ 5
- 0
src/main/org/apache/tools/ant/taskdefs/RecorderEntry.java View File

@@ -237,6 +237,11 @@ public class RecorderEntry implements BuildLogger, SubBuildListener {
}
}

@Override
public int getMessageOutputLevel() {
return this.loglevel;
}

/**
* @see BuildLogger#setOutputPrintStream(PrintStream)
* {@inheritDoc}.


Loading…
Cancel
Save