Index: apps/Fop.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/apps/Fop.java,v
retrieving revision 1.9
diff -u -r1.9 Fop.java
--- apps/Fop.java	31 Mar 2004 10:55:05 -0000	1.9
+++ apps/Fop.java	6 Apr 2004 17:30:10 -0000
@@ -22,8 +22,6 @@
 import java.io.BufferedOutputStream;
 import java.io.FileOutputStream;
 
-import org.apache.commons.logging.impl.SimpleLog;
-
 // FOP
 import org.apache.fop.render.awt.AWTRenderer;
 
@@ -45,12 +43,11 @@
 
         try {
             Driver driver = new Driver();
-            SimpleLog log = new SimpleLog("FOP");
-            log.setLevel(SimpleLog.LOG_LEVEL_INFO);
-            driver.setLogger(log);
             
-            driver.getLogger().info(version);
             options = new CommandLineOptions(args);
+            driver.setLogger(options.getLogger());
+
+            driver.getLogger().info(version);
             inputHandler = options.getInputHandler();
 
             try {
Index: apps/CommandLineOptions.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java,v
retrieving revision 1.16
diff -u -r1.16 CommandLineOptions.java
--- apps/CommandLineOptions.java	31 Mar 2004 10:55:05 -0000	1.16
+++ apps/CommandLineOptions.java	6 Apr 2004 17:30:13 -0000
@@ -24,6 +24,9 @@
 import java.util.Locale;
 import java.util.Vector;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.commons.logging.impl.SimpleLog;
 
 /**
@@ -60,8 +63,6 @@
 
     /* show configuration information */
     private Boolean dumpConfiguration = 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 */
@@ -81,7 +82,7 @@
 
     private java.util.HashMap rendererOptions;
 
-    private SimpleLog log;
+    private Log log;
 
     private Vector xsltParams = null;
     
@@ -94,14 +95,14 @@
     public CommandLineOptions(String[] args)
             throws FOPException, FileNotFoundException {
 
-        log = new SimpleLog("FOP");
-        log.setLevel(SimpleLog.LOG_LEVEL_INFO);
+        log = LogFactory.getLog("FOP");
 
         boolean optionsParsed = true;
         rendererOptions = new java.util.HashMap();
         try {
             optionsParsed = parseOptions(args);
             if (optionsParsed) {
+                if (dumpConfiguration() == Boolean.TRUE) debug();
                 checkSettings();
             }
         } catch (FOPException e) {
@@ -117,7 +118,7 @@
      * Get the logger.
      * @return the logger
      */
-    public SimpleLog getLogger() {
+    public Log getLogger() {
         return log;
     }
 
@@ -130,15 +131,18 @@
     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");
-                log.setLevel(SimpleLog.LOG_LEVEL_DEBUG);
+                if (!log.isDebugEnabled()) {
+                    log = new SimpleLog("FOP");
+                    ((SimpleLog) log).setLevel(SimpleLog.LOG_LEVEL_DEBUG);
+                } 
             } else if (args[i].equals("-x")
                        || args[i].equals("--dump-config")) {
                 dumpConfiguration = Boolean.TRUE;
             } else if (args[i].equals("-q") || args[i].equals("--quiet")) {
-                quiet = Boolean.TRUE;
-                log = new SimpleLog("FOP");
-                log.setLevel(SimpleLog.LOG_LEVEL_ERROR);
+                if (log.isWarnEnabled()) {
+                    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")) {
@@ -552,7 +556,7 @@
      * @return true if should be silent
      */
     public Boolean isQuiet() {
-        return quiet;
+        return new Boolean(!log.isWarnEnabled());
     }
 
     /**
@@ -644,6 +648,12 @@
      * debug mode. outputs all commandline settings
      */
     private void debug() {
+        Log log = this.log;
+        if (!log.isDebugEnabled()) {
+            log.info("Debug logging is not enabled; using SimpleLog");
+            log = new SimpleLog("FOP");
+            ((SimpleLog) log).setLevel(SimpleLog.LOG_LEVEL_DEBUG);
+        }
         log.debug("Input mode: ");
         switch (inputmode) {
         case NOT_SET:
@@ -725,7 +735,7 @@
         } else {
             log.debug("don't dump configuration [default]");
         }
-        if (quiet != null) {
+        if (!log.isWarnEnabled()) {
             log.debug("quiet mode on");
         } else {
             log.debug("quiet mode off [default]");
