*/
package jalview.bin;
+import java.util.Locale;
+
import jalview.log.JLogger;
+import jalview.log.JLoggerI;
import jalview.log.JLoggerI.LogLevel;
import jalview.log.JLoggerLog4j;
import jalview.util.ChannelProperties;
// Test message
if (log != null)
{
- // Logging test message should got through the logger object
+ // Logging test message should go through the logger object
if (log.loggerExists())
log.debug(Console.LOGGING_TEST_MESSAGE);
// Tell the user that debug is enabled
}
}
+ public static void setLogLevel(String logLevelString)
+ {
+ for (LogLevel logLevel : JLoggerI.LogLevel.values())
+ {
+ if (logLevel.toString().toLowerCase(Locale.ROOT)
+ .equals(logLevelString.toLowerCase(Locale.ROOT)))
+ {
+ log.setLevel(logLevel);
+ if (!Platform.isJS())
+ {
+ Log4j.init(logLevel);
+ }
+ JLoggerLog4j.getLogger("org.apache.axis", logLevel);
+ break;
+ }
+ }
+ }
+
public final static String LOGGING_TEST_MESSAGE = "Logging to STDERR";
}