diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/AntTaskSimpleLoggerAdapter.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/AntTaskSimpleLoggerAdapter.java index 3ff87f11a1317058fdabaf7bd97fd5d2f6fc73c2..61fe425110ca8756d9400d352c14d9c976822951 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/AntTaskSimpleLoggerAdapter.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/AntTaskSimpleLoggerAdapter.java @@ -20,6 +20,7 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import ch.systemsx.cisd.common.logging.ISimpleLogger; +import ch.systemsx.cisd.common.logging.LogLevel; /** * An adapter of a ant task to an {@link ISimpleLogger}. @@ -31,15 +32,23 @@ public class AntTaskSimpleLoggerAdapter implements ISimpleLogger private final Task antTask; - private final static int toAntLogLevel(ISimpleLogger.Level level) + private final static int toAntLogLevel(LogLevel level) { switch (level) { - case ERROR: return Project.MSG_ERR; - case WARN: return Project.MSG_WARN; - case INFO: return Project.MSG_INFO; - case DEBUG: return Project.MSG_DEBUG; - default: throw new IllegalArgumentException("Unknonwn log level " + level); + case OFF: + return Project.MSG_DEBUG; + case TRACE: + return Project.MSG_VERBOSE; + case DEBUG: + return Project.MSG_DEBUG; + case INFO: + return Project.MSG_INFO; + case WARN: + return Project.MSG_WARN; + case ERROR: + return Project.MSG_ERR; + default: throw new IllegalArgumentException("Illegal log level " + level); } } @@ -48,7 +57,7 @@ public class AntTaskSimpleLoggerAdapter implements ISimpleLogger this.antTask = antTask; } - public void log(ISimpleLogger.Level level, String message) + public void log(LogLevel level, String message) { antTask.log(message, toAntLogLevel(level)); } diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java index 341f117346e401f8dca69127461e885f499c65c0..b4ae6fa7364b379d890d5ff2e52e9308b63f855f 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java @@ -32,7 +32,7 @@ import ch.systemsx.cisd.ant.common.StringUtils; import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.common.logging.ISimpleLogger; -import ch.systemsx.cisd.common.logging.ISimpleLogger.Level; +import ch.systemsx.cisd.common.logging.LogLevel; import ch.systemsx.cisd.common.utilities.OSUtilities; /** @@ -271,7 +271,7 @@ class SVNUtilities final ProcessBuilder builder = new ProcessBuilder(fullCommand); builder.redirectErrorStream(redirectErrorStream); final String commandString = StringUtils.join(builder.command(), " "); - logger.log(Level.INFO, String.format("Executing '%s'", commandString)); + logger.log(LogLevel.INFO, String.format("Executing '%s'", commandString)); try { final Process process = builder.start(); @@ -318,7 +318,7 @@ class SVNUtilities final ProcessBuilder builder = new ProcessBuilder(fullCommand); builder.redirectErrorStream(true); final String commandString = StringUtils.join(builder.command(), " "); - logger.log(Level.INFO, String.format("Executing '%s'", commandString)); + logger.log(LogLevel.INFO, String.format("Executing '%s'", commandString)); try { final Process process = builder.start(); @@ -347,7 +347,7 @@ class SVNUtilities { for (String line : output) { - logger.log(Level.INFO, String.format("SVN > %s", line)); + logger.log(LogLevel.INFO, String.format("SVN > %s", line)); } }