gmazza 2004/04/18 15:39:02 Modified: . fop.bat fop.sh src/java/org/apache/fop/apps CommandLineOptions.java Log: Remaining changes done with Avalon->Commons Logging conversion. (Bug 28237) Revision Changes Path 1.19 +16 -1 xml-fop/fop.bat Index: fop.bat =================================================================== RCS file: /home/cvs/xml-fop/fop.bat,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- fop.bat 31 Mar 2004 10:55:05 -0000 1.18 +++ fop.bat 18 Apr 2004 22:39:02 -0000 1.19 @@ -21,6 +21,21 @@ rem and for NT handling to skip to. :doneStart +set LOGCHOICE= +rem The default commons logger for JDK1.4 is JDK1.4Logger. +rem To use a different logger, uncomment the one desired below +rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog +rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog +rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger + +set LOGLEVEL= +rem Logging levels +rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger. +rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties +rem file instead. +rem Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal". +rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO + set LIBDIR=%LOCAL_FOP_HOME%lib set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar @@ -34,5 +49,5 @@ set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar -java -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %FOP_CMD_LINE_ARGS% +java %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %FOP_CMD_LINE_ARGS% 1.6 +16 -1 xml-fop/fop.sh Index: fop.sh =================================================================== RCS file: /home/cvs/xml-fop/fop.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- fop.sh 30 Nov 2002 08:54:25 -0000 1.5 +++ fop.sh 18 Apr 2004 22:39:02 -0000 1.6 @@ -100,5 +100,20 @@ LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` fi -$JAVACMD -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.apps.Fop "$@" +LOGCHOICE= +# The default commons logger for JDK1.4 is JDK1.4Logger. +# To use a different logger, uncomment the one desired below +# LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog +# LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog +# LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger + +LOGLEVEL= +# Logging levels +# Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger. +# To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%/JRE/LIB/logging.properties +# file instead. +# Possible SimpleLog values: "trace", "debug", "info" (default), "warn", "error", or "fatal". +# LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO + +$JAVACMD $LOGCHOICE $LOGLEVEL -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.apps.Fop "$@" 1.18 +33 -50 xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java Index: CommandLineOptions.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- CommandLineOptions.java 9 Apr 2004 03:05:40 -0000 1.17 +++ CommandLineOptions.java 18 Apr 2004 22:39:02 -0000 1.18 @@ -61,8 +61,6 @@ /* show configuration information */ private Boolean showConfiguration = Boolean.FALSE; - /* suppress any progress information */ - private Boolean quiet = Boolean.FALSE; /* for area tree XML output, only down to block area level */ private Boolean suppressLowLevelAreas = Boolean.FALSE; /* user configuration file */ @@ -132,16 +130,9 @@ */ private boolean parseOptions(String[] args) throws FOPException { for (int i = 0; i < args.length; i++) { - if (args[i].equals("-d") || args[i].equals("--full-error-dump")) { - log = new SimpleLog("FOP"); - ((SimpleLog) log).setLevel(SimpleLog.LOG_LEVEL_DEBUG); - } else if (args[i].equals("-x") + if (args[i].equals("-x") || args[i].equals("--dump-config")) { showConfiguration = Boolean.TRUE; - } else if (args[i].equals("-q") || args[i].equals("--quiet")) { - quiet = Boolean.TRUE; - log = new SimpleLog("FOP"); - ((SimpleLog) log).setLevel(SimpleLog.LOG_LEVEL_ERROR); } else if (args[i].equals("-c")) { i = i + parseConfigurationOption(args, i); } else if (args[i].equals("-l")) { @@ -581,9 +572,7 @@ "\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] " + "[-awt|-pdf|-mif|-rtf|-pcl|-ps|-txt|-at|-print] <outfile>\n" + " [OPTIONS] \n" - + " -d debug mode \n" + " -x dump configuration settings \n" - + " -q quiet mode \n" + " -c cfg.xml use additional configuration file cfg.xml\n" + " -l lang the language to use for user information \n" + " -s for area tree XML, down to block areas only\n\n" @@ -628,90 +617,84 @@ /** - * debug mode. outputs all commandline settings + * Outputs all commandline settings */ private void dumpConfiguration() { - log.debug("Input mode: "); + log.info("Input mode: "); switch (inputmode) { case NOT_SET: - log.debug("not set"); + log.info("not set"); break; case FO_INPUT: - log.debug("FO "); - log.debug("fo input file: " + fofile.toString()); + log.info("FO "); + log.info("fo input file: " + fofile.toString()); break; case XSLT_INPUT: - log.debug("xslt transformation"); - log.debug("xml input file: " + xmlfile.toString()); - log.debug("xslt stylesheet: " + xsltfile.toString()); + log.info("xslt transformation"); + log.info("xml input file: " + xmlfile.toString()); + log.info("xslt stylesheet: " + xsltfile.toString()); break; default: - log.debug("unknown input type"); + log.info("unknown input type"); } - log.debug("Output mode: "); + log.info("Output mode: "); switch (outputmode) { case NOT_SET: - log.debug("not set"); + log.info("not set"); break; case PDF_OUTPUT: - log.debug("pdf"); - log.debug("output file: " + outfile.toString()); + log.info("pdf"); + log.info("output file: " + outfile.toString()); break; case AWT_OUTPUT: - log.debug("awt on screen"); + log.info("awt on screen"); if (outfile != null) { log.error("awt mode, but outfile is set:"); - log.debug("out file: " + outfile.toString()); + log.info("out file: " + outfile.toString()); } break; case MIF_OUTPUT: - log.debug("mif"); - log.debug("output file: " + outfile.toString()); + log.info("mif"); + log.info("output file: " + outfile.toString()); break; case RTF_OUTPUT: - log.debug("rtf"); - log.debug("output file: " + outfile.toString()); + log.info("rtf"); + log.info("output file: " + outfile.toString()); break; case PRINT_OUTPUT: - log.debug("print directly"); + log.info("print directly"); if (outfile != null) { log.error("print mode, but outfile is set:"); log.error("out file: " + outfile.toString()); } break; case PCL_OUTPUT: - log.debug("pcl"); - log.debug("output file: " + outfile.toString()); + log.info("pcl"); + log.info("output file: " + outfile.toString()); break; case PS_OUTPUT: - log.debug("PostScript"); - log.debug("output file: " + outfile.toString()); + log.info("PostScript"); + log.info("output file: " + outfile.toString()); break; case TXT_OUTPUT: - log.debug("txt"); - log.debug("output file: " + outfile.toString()); + log.info("txt"); + log.info("output file: " + outfile.toString()); break; case SVG_OUTPUT: - log.debug("svg"); - log.debug("output file: " + outfile.toString()); + log.info("svg"); + log.info("output file: " + outfile.toString()); break; default: - log.debug("unknown input type"); + log.info("unknown input type"); } - log.debug("OPTIONS"); + log.info("OPTIONS"); if (userConfigFile != null) { - log.debug("user configuration file: " + log.info("user configuration file: " + userConfigFile.toString()); } else { - log.debug("no user configuration file is used [default]"); - } - - if (quiet == Boolean.TRUE) { - log.debug("quiet mode off [default]"); - } else { - log.debug("quiet mode on"); + log.info("no user configuration file is used [default]"); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]