logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1521650 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Date Tue, 10 Sep 2013 21:26:18 GMT
Author: ggregory
Date: Tue Sep 10 21:26:18 2013
New Revision: 1521650

URL: http://svn.apache.org/r1521650
Log:
Better log messages.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java?rev=1521650&r1=1521649&r2=1521650&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Tue Sep 10 21:26:18 2013
@@ -48,6 +48,7 @@ import org.apache.logging.log4j.util.Pro
 @Plugin(name = "Console", category = "Core", elementType = "appender", printObject = true)
 public final class ConsoleAppender extends AbstractOutputStreamAppender {
 
+    private static final String JANSI_CLASS = "org.fusesource.jansi.WindowsAnsiOutputStream";
     private static ConsoleManagerFactory factory = new ConsoleManagerFactory();
 
     /**
@@ -122,15 +123,15 @@ public final class ConsoleAppender exten
         try {
             final ClassLoader loader = Loader.getClassLoader();
             // We type the parameter as a wildcard to avoid a hard reference to Jansi.
-            final Class<?> clazz = loader.loadClass("org.fusesource.jansi.WindowsAnsiOutputStream");
+            final Class<?> clazz = loader.loadClass(JANSI_CLASS);
             final Constructor<?> constructor = clazz.getConstructor(OutputStream.class);
             return (OutputStream) constructor.newInstance(printStream);
         } catch (final ClassNotFoundException cnfe) {
-            LOGGER.debug("Jansi is not installed");
+            LOGGER.debug("Jansi is not installed, cannot find {}", JANSI_CLASS);
         } catch (final NoSuchMethodException nsme) {
-            LOGGER.warn("WindowsAnsiOutputStream is missing the proper constructor");
+            LOGGER.warn("{} is missing the proper constructor", JANSI_CLASS);
         } catch (final Exception ex) {
-            LOGGER.warn("Unable to instantiate WindowsAnsiOutputStream");
+            LOGGER.warn("Unable to instantiate {}", JANSI_CLASS);
         }
         return printStream;
     }



Mime
View raw message