From 83ac572934ad398409b09c3223e01da003ca1beb Mon Sep 17 00:00:00 2001 From: adammurdoch Date: Tue, 26 Mar 2002 02:14:02 +0000 Subject: [PATCH] * Added --debug command-line option. * Changed --log-level to map logging levels so that they match the TaskContext log methods. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272031 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/myrmidon/frontends/CLIMain.java | 21 +++++++++++++++---- .../myrmidon/frontends/Resources.properties | 7 ++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java index ce58a2f93..4d42940da 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java @@ -54,6 +54,7 @@ public class CLIMain private final static int INCREMENTAL_OPT = 6; private final static int HOME_DIR_OPT = 7; private final static int DRY_RUN_OPT = 8; + private final static int DEBUG_OPT = 9; //incompatable options for info options private final static int[] INFO_OPT_INCOMPAT = new int[] @@ -67,7 +68,7 @@ public class CLIMain //incompatable options for other logging options private final static int[] LOG_OPT_INCOMPAT = new int[] { - QUIET_OPT, VERBOSE_OPT, LOG_LEVEL_OPT + QUIET_OPT, VERBOSE_OPT, LOG_LEVEL_OPT, DEBUG_OPT }; //incompatible options for listener options @@ -169,6 +170,11 @@ public class CLIMain VERBOSE_OPT, REZ.getString( "verbose.opt" ), LOG_OPT_INCOMPAT ), + new CLOptionDescriptor( "debug", + CLOptionDescriptor.ARGUMENT_DISALLOWED, + DEBUG_OPT, + REZ.getString( "debug.opt" ), + LOG_OPT_INCOMPAT ), new CLOptionDescriptor( "listener", CLOptionDescriptor.ARGUMENT_REQUIRED, LISTENER_OPT, @@ -255,6 +261,9 @@ public class CLIMain case VERBOSE_OPT: m_priority = BasicLogger.LEVEL_INFO; break; + case DEBUG_OPT: + m_priority = BasicLogger.LEVEL_DEBUG; + break; case QUIET_OPT: m_priority = BasicLogger.LEVEL_ERROR; break; @@ -426,18 +435,22 @@ public class CLIMain { return BasicLogger.LEVEL_DEBUG; } - else if( "INFO".equals( logLevelCapitalized ) ) + else if( "VERBOSE".equals( logLevelCapitalized ) ) { return BasicLogger.LEVEL_INFO; } - else if( "WARN".equals( logLevelCapitalized ) ) + else if( "INFO".equals( logLevelCapitalized ) ) { return BasicLogger.LEVEL_WARN; } - else if( "ERROR".equals( logLevelCapitalized ) ) + else if( "WARN".equals( logLevelCapitalized ) ) { return BasicLogger.LEVEL_ERROR; } + else if( "ERROR".equals( logLevelCapitalized ) ) + { + return BasicLogger.LEVEL_FATAL; + } else { final String message = REZ.getString( "bad-loglevel.error", logLevel ); diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/Resources.properties index eb62e0298..eca021877 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/Resources.properties @@ -2,9 +2,10 @@ error-message=Error: {0}. help.opt=Display this help message. file.opt=Specify the build file. -log-level.opt=Specify the verbosity level at which to log messages. (DEBUG|INFO|WARN|ERROR|FATAL_ERROR). -quiet.opt=Equivalent to --log-level=FATAL_ERROR. -verbose.opt=Equivalent to --log-level=INFO. +log-level.opt=Specify the verbosity level at which to log messages. (DEBUG|VERBOSE|INFO|WARN|ERROR). +quiet.opt=Equivalent to --log-level=ERROR. +verbose.opt=Equivalent to --log-level=VERBOSE. +debug.opt=Equivalent to --log-level=DEBUG. listener.opt=Specify the listener for log events. noprefix.opt=Do not prefix output with the task name. Equivalent to --listener noprefix. version.opt=Display version.