[slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch master updated. v_1.7.1-15-ge74da9a

Gitbot git-noreply at pixie.qos.ch
Thu Oct 11 18:13:58 CEST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SLF4J: Simple Logging Facade for Java".

The branch, master has been updated
       via  e74da9a73fc96401f39e00604fb4ad83ac31ffaf (commit)
      from  73af0c60de69cf37fabaded3a635e1751250c4e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=e74da9a73fc96401f39e00604fb4ad83ac31ffaf
http://github.com/ceki/slf4j/commit/e74da9a73fc96401f39e00604fb4ad83ac31ffaf

commit e74da9a73fc96401f39e00604fb4ad83ac31ffaf
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Oct 11 18:13:16 2012 +0200

    added warnLevelString property

diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Appender.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Appender.java
index 5b0c571..7623309 100644
--- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Appender.java
+++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Appender.java
@@ -29,106 +29,106 @@ import org.apache.log4j.spi.LoggingEvent;
  */
 public interface Appender {
 
-    /**
-     * Add a filter to the end of the filter list.
-     *
-     * @since 0.9.0
-     */
-    void addFilter(Filter newFilter);
+  /**
+   * Add a filter to the end of the filter list.
+   *
+   * @since 0.9.0
+   */
+  void addFilter(Filter newFilter);
 
-    /**
-     * Returns the head Filter. The Filters are organized in a linked list
-     * and so all Filters on this Appender are available through the result.
-     *
-     * @return the head Filter or null, if no Filters are present
-     * @since 1.1
-     */
-    public Filter getFilter();
+  /**
+   * Returns the head Filter. The Filters are organized in a linked list
+   * and so all Filters on this Appender are available through the result.
+   *
+   * @return the head Filter or null, if no Filters are present
+   * @since 1.1
+   */
+  public Filter getFilter();
 
-    /**
-     * Clear the list of filters by removing all the filters in it.
-     *
-     * @since 0.9.0
-     */
-    public void clearFilters();
+  /**
+   * Clear the list of filters by removing all the filters in it.
+   *
+   * @since 0.9.0
+   */
+  public void clearFilters();
 
-    /**
-     * Release any resources allocated within the appender such as file
-     * handles, network connections, etc.
-     * <p/>
-     * <p>It is a programming error to append to a closed appender.
-     *
-     * @since 0.8.4
-     */
-    public void close();
+  /**
+   * Release any resources allocated within the appender such as file
+   * handles, network connections, etc.
+   * <p/>
+   * <p>It is a programming error to append to a closed appender.
+   *
+   * @since 0.8.4
+   */
+  public void close();
 
-    /**
-     * Log in <code>Appender</code> specific way. When appropriate,
-     * Loggers will call the <code>doAppend</code> method of appender
-     * implementations in order to log.
-     */
-    public void doAppend(LoggingEvent event);
+  /**
+   * Log in <code>Appender</code> specific way. When appropriate,
+   * Loggers will call the <code>doAppend</code> method of appender
+   * implementations in order to log.
+   */
+  public void doAppend(LoggingEvent event);
 
 
-    /**
-     * Get the name of this appender. The name uniquely identifies the
-     * appender.
-     */
-    public String getName();
+  /**
+   * Get the name of this appender. The name uniquely identifies the
+   * appender.
+   */
+  public String getName();
 
 
-    /**
-     * Set the {@link ErrorHandler} for this appender.
-     *
-     * @since 0.9.0
-     */
-    public void setErrorHandler(ErrorHandler errorHandler);
+  /**
+   * Set the {@link ErrorHandler} for this appender.
+   *
+   * @since 0.9.0
+   */
+  public void setErrorHandler(ErrorHandler errorHandler);
 
-    /**
-     * Returns the {@link ErrorHandler} for this appender.
-     *
-     * @since 1.1
-     */
-    public ErrorHandler getErrorHandler();
+  /**
+   * Returns the {@link ErrorHandler} for this appender.
+   *
+   * @since 1.1
+   */
+  public ErrorHandler getErrorHandler();
 
-    /**
-     * Set the {@link Layout} for this appender.
-     *
-     * @since 0.8.1
-     */
-    public void setLayout(Layout layout);
+  /**
+   * Set the {@link Layout} for this appender.
+   *
+   * @since 0.8.1
+   */
+  public void setLayout(Layout layout);
 
-    /**
-     * Returns this appenders layout.
-     *
-     * @since 1.1
-     */
-    public Layout getLayout();
+  /**
+   * Returns this appenders layout.
+   *
+   * @since 1.1
+   */
+  public Layout getLayout();
 
 
-    /**
-     * Set the name of this appender. The name is used by other
-     * components to identify this appender.
-     *
-     * @since 0.8.1
-     */
-    public void setName(String name);
+  /**
+   * Set the name of this appender. The name is used by other
+   * components to identify this appender.
+   *
+   * @since 0.8.1
+   */
+  public void setName(String name);
 
-    /**
-     * Configurators call this method to determine if the appender
-     * requires a layout. If this method returns <code>true</code>,
-     * meaning that layout is required, then the configurator will
-     * configure an layout using the configuration information at its
-     * disposal.  If this method returns <code>false</code>, meaning that
-     * a layout is not required, then layout configuration will be
-     * skipped even if there is available layout configuration
-     * information at the disposal of the configurator..
-     * <p/>
-     * <p>In the rather exceptional case, where the appender
-     * implementation admits a layout but can also work without it, then
-     * the appender should return <code>true</code>.
-     *
-     * @since 0.8.4
-     */
-    public boolean requiresLayout();
+  /**
+   * Configurators call this method to determine if the appender
+   * requires a layout. If this method returns <code>true</code>,
+   * meaning that layout is required, then the configurator will
+   * configure an layout using the configuration information at its
+   * disposal.  If this method returns <code>false</code>, meaning that
+   * a layout is not required, then layout configuration will be
+   * skipped even if there is available layout configuration
+   * information at the disposal of the configurator..
+   * <p/>
+   * <p>In the rather exceptional case, where the appender
+   * implementation admits a layout but can also work without it, then
+   * the appender should return <code>true</code>.
+   *
+   * @since 0.8.4
+   */
+  public boolean requiresLayout();
 }
diff --git a/slf4j-simple/src/main/java/org/slf4j/impl/SimpleLogger.java b/slf4j-simple/src/main/java/org/slf4j/impl/SimpleLogger.java
index 6f4493b..6a70ec5 100644
--- a/slf4j-simple/src/main/java/org/slf4j/impl/SimpleLogger.java
+++ b/slf4j-simple/src/main/java/org/slf4j/impl/SimpleLogger.java
@@ -79,6 +79,10 @@ import org.slf4j.spi.LocationAwareLogger;
  *
  * <li><code>org.slf4j.simpleLogger.levelInBrackets</code> - Should the level string be output in brackets? Defaults
  * to <code>false</code>.</li>
+ *
+ * <li><code>org.slf4j.simpleLogger.warnLevelString</code> - The string value output for the warn level. Defaults
+ * to <code>WARN</code>.</li>
+
  * </ul>
  *
  * <p>In addition to looking for system properties with the names specified above, this implementation also checks for
@@ -137,6 +141,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
   private static String LOG_FILE = "System.err";
   private static PrintStream TARGET_STREAM = null;
   private static boolean LEVEL_IN_BRACKETS = false;
+  private static String WARN_LEVEL_STRING = "WARN";
 
 
   /** All system properties used by <code>SimpleLogger</code> start with this prefix */
@@ -150,6 +155,8 @@ public class SimpleLogger extends MarkerIgnoringBase {
   public static final String SHOW_SHORT_LOG_NAME_KEY = SYSTEM_PREFIX + "showShortLogName";
   public static final String LOG_FILE_KEY = SYSTEM_PREFIX + "logFile";
   public static final String LEVEL_IN_BRACKETS_KEY = SYSTEM_PREFIX + "levelInBrackets";
+  public static final String WARN_LEVEL_STRING_KEY = SYSTEM_PREFIX + "warnLevelString";
+
 
   public static final String LOG_KEY_PREFIX = SYSTEM_PREFIX + "log.";
 
@@ -192,6 +199,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
     SHOW_THREAD_NAME = getBooleanProperty(SHOW_THREAD_NAME_KEY, SHOW_THREAD_NAME);
     DATE_TIME_FORMAT_STR = getStringProperty(DATE_TIME_FORMAT_KEY, DATE_TIME_FORMAT_STR);
     LEVEL_IN_BRACKETS = getBooleanProperty(LEVEL_IN_BRACKETS_KEY, LEVEL_IN_BRACKETS);
+    WARN_LEVEL_STRING = getStringProperty(WARN_LEVEL_STRING_KEY, WARN_LEVEL_STRING);
 
     LOG_FILE = getStringProperty(LOG_FILE_KEY, LOG_FILE);
     TARGET_STREAM = computeTargetStream(LOG_FILE);
@@ -345,7 +353,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
         buf.append("INFO");
         break;
       case LOG_LEVEL_WARN:
-        buf.append("WARN");
+        buf.append(WARN_LEVEL_STRING);
         break;
       case LOG_LEVEL_ERROR:
         buf.append("ERROR");

-----------------------------------------------------------------------

Summary of changes:
 .../src/main/java/org/apache/log4j/Appender.java   |  176 ++++++++++----------
 .../src/main/java/org/slf4j/impl/SimpleLogger.java |   10 +-
 2 files changed, 97 insertions(+), 89 deletions(-)


hooks/post-receive
-- 
SLF4J: Simple Logging Facade for Java


More information about the slf4j-dev mailing list