Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47828
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Sep 2009 10:38:23 +0000 (10:38 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Sep 2009 10:38:23 +0000 (10:38 +0000)
Change Tomcat.setSilent() to setSilent(boolean) so it can be turned on and off

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@815264 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/Tomcat.java

index fcd0130..14ba59d 100644 (file)
@@ -543,13 +543,20 @@ public class Tomcat {
     };
     
     /**
-     * Sets the log level to WARN for the loggers that log information on
-     * Tomcat start up. This prevents the usual startup information being
-     * logged to the console.
+     * Controls if the loggers will be silenced or not.
+     * @param silent    <code>true</code> sets the log level to WARN for the
+     *                  loggers that log information on Tomcat start up. This
+     *                  prevents the usual startup information being logged.
+     *                  <code>false</code> sets the log level to the default
+     *                  level of INFO.
      */
-    public void setSilent() {
+    public void setSilent(boolean silent) {
         for (String s : silences) {
-            Logger.getLogger(s).setLevel(Level.WARNING);
+            if (silent) {
+                Logger.getLogger(s).setLevel(Level.WARNING);
+            } else {
+                Logger.getLogger(s).setLevel(Level.INFO);
+            }
         }
     }