Browse Source

* 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
master
adammurdoch 23 years ago
parent
commit
83ac572934
2 changed files with 21 additions and 7 deletions
  1. +17
    -4
      proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java
  2. +4
    -3
      proposal/myrmidon/src/java/org/apache/myrmidon/frontends/Resources.properties

+ 17
- 4
proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java View File

@@ -54,6 +54,7 @@ public class CLIMain
private final static int INCREMENTAL_OPT = 6; private final static int INCREMENTAL_OPT = 6;
private final static int HOME_DIR_OPT = 7; private final static int HOME_DIR_OPT = 7;
private final static int DRY_RUN_OPT = 8; private final static int DRY_RUN_OPT = 8;
private final static int DEBUG_OPT = 9;


//incompatable options for info options //incompatable options for info options
private final static int[] INFO_OPT_INCOMPAT = new int[] private final static int[] INFO_OPT_INCOMPAT = new int[]
@@ -67,7 +68,7 @@ public class CLIMain
//incompatable options for other logging options //incompatable options for other logging options
private final static int[] LOG_OPT_INCOMPAT = new int[] 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 //incompatible options for listener options
@@ -169,6 +170,11 @@ public class CLIMain
VERBOSE_OPT, VERBOSE_OPT,
REZ.getString( "verbose.opt" ), REZ.getString( "verbose.opt" ),
LOG_OPT_INCOMPAT ), LOG_OPT_INCOMPAT ),
new CLOptionDescriptor( "debug",
CLOptionDescriptor.ARGUMENT_DISALLOWED,
DEBUG_OPT,
REZ.getString( "debug.opt" ),
LOG_OPT_INCOMPAT ),
new CLOptionDescriptor( "listener", new CLOptionDescriptor( "listener",
CLOptionDescriptor.ARGUMENT_REQUIRED, CLOptionDescriptor.ARGUMENT_REQUIRED,
LISTENER_OPT, LISTENER_OPT,
@@ -255,6 +261,9 @@ public class CLIMain
case VERBOSE_OPT: case VERBOSE_OPT:
m_priority = BasicLogger.LEVEL_INFO; m_priority = BasicLogger.LEVEL_INFO;
break; break;
case DEBUG_OPT:
m_priority = BasicLogger.LEVEL_DEBUG;
break;
case QUIET_OPT: case QUIET_OPT:
m_priority = BasicLogger.LEVEL_ERROR; m_priority = BasicLogger.LEVEL_ERROR;
break; break;
@@ -426,18 +435,22 @@ public class CLIMain
{ {
return BasicLogger.LEVEL_DEBUG; return BasicLogger.LEVEL_DEBUG;
} }
else if( "INFO".equals( logLevelCapitalized ) )
else if( "VERBOSE".equals( logLevelCapitalized ) )
{ {
return BasicLogger.LEVEL_INFO; return BasicLogger.LEVEL_INFO;
} }
else if( "WARN".equals( logLevelCapitalized ) )
else if( "INFO".equals( logLevelCapitalized ) )
{ {
return BasicLogger.LEVEL_WARN; return BasicLogger.LEVEL_WARN;
} }
else if( "ERROR".equals( logLevelCapitalized ) )
else if( "WARN".equals( logLevelCapitalized ) )
{ {
return BasicLogger.LEVEL_ERROR; return BasicLogger.LEVEL_ERROR;
} }
else if( "ERROR".equals( logLevelCapitalized ) )
{
return BasicLogger.LEVEL_FATAL;
}
else else
{ {
final String message = REZ.getString( "bad-loglevel.error", logLevel ); final String message = REZ.getString( "bad-loglevel.error", logLevel );


+ 4
- 3
proposal/myrmidon/src/java/org/apache/myrmidon/frontends/Resources.properties View File

@@ -2,9 +2,10 @@ error-message=Error: {0}.


help.opt=Display this help message. help.opt=Display this help message.
file.opt=Specify the build file. 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. listener.opt=Specify the listener for log events.
noprefix.opt=Do not prefix output with the task name. Equivalent to --listener noprefix. noprefix.opt=Do not prefix output with the task name. Equivalent to --listener noprefix.
version.opt=Display version. version.opt=Display version.


Loading…
Cancel
Save