Adding ability to undo the log-level change, to some extent...it's not too elegant, but it should work in most cases.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@498043 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2007-01-20 02:02:47 +00:00
parent 4ca4301f1d
commit cf308da3de
1 changed files with 19 additions and 9 deletions

View File

@ -59,6 +59,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException;
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
import org.codehaus.plexus.logging.LoggerManager;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File;
@ -565,8 +566,12 @@ public class MavenEmbedder
public MavenExecutionResult execute( MavenExecutionRequest request )
{
LoggerManager loggerManager = container.getLoggerManager();
int oldThreshold = loggerManager.getThreshold();
container.getLoggerManager().setThresholds( request.getLoggingLevel() );
try
{
loggerManager.setThresholds( request.getLoggingLevel() );
try
{
@ -579,4 +584,9 @@ public class MavenEmbedder
return maven.execute( request );
}
finally
{
loggerManager.setThresholds( oldThreshold );
}
}
}