incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r652823 - in /incubator/sling/trunk/osgi/log/src/main/java/org: apache/sling/osgi/log/slf4j/SlingLogFileWriter.java apache/sling/osgi/log/slf4j/SlingLoggerFactory.java slf4j/impl/StaticLoggerBinder.java
Date Fri, 02 May 2008 17:01:42 GMT
Author: cziegeler
Date: Fri May  2 10:01:41 2008
New Revision: 652823

URL: http://svn.apache.org/viewvc?rev=652823&view=rev
Log:
Clean up code.

Modified:
    incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLogFileWriter.java
    incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLoggerFactory.java
    incubator/sling/trunk/osgi/log/src/main/java/org/slf4j/impl/StaticLoggerBinder.java

Modified: incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLogFileWriter.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLogFileWriter.java?rev=652823&r1=652822&r2=652823&view=diff
==============================================================================
--- incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLogFileWriter.java
(original)
+++ incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLogFileWriter.java
Fri May  2 10:01:41 2008
@@ -21,7 +21,6 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
 
@@ -30,8 +29,7 @@
     private static final long FACTOR_KB = 1024;
     private static final long FACTOR_MB = 1024 * FACTOR_KB;
     private static final long FACTOR_GB = 1024 * FACTOR_MB;
-    private static final long DEFAULT_MAX_SIZE = 10 * FACTOR_GB;
-    
+
     private final File file;
 
     private final String path;
@@ -43,15 +41,15 @@
     public SlingLogFileWriter(String logFileName, int fileNum, String fileSize) throws IOException
{
         this(logFileName, fileNum, convertMaxSizeSpec(fileSize));
     }
-    
+
     public SlingLogFileWriter(String logFileName, int fileNum, long fileSize) throws IOException
{
-        
+
         // make sure the file is absolute and derive the path from there
         File file = new File(logFileName);
         if (!file.isAbsolute()) {
             file = file.getAbsoluteFile();
         }
-        
+
         this.path = file.getAbsolutePath();
         this.file = file;
 
@@ -67,7 +65,7 @@
 
         checkRotate();
     }
-    
+
     private Writer createFile() throws IOException {
         // ensure parent path of the file to create
         file.getParentFile().mkdirs();
@@ -84,7 +82,7 @@
                 getDelegatee().close();
 
                 if (maxNum >= 0) {
-                    
+
                     // remove oldest file
                     File dstFile = new File(path + "." + maxNum);
                     if (dstFile.exists()) {
@@ -102,14 +100,14 @@
 
                     // rename youngest file
                     file.renameTo(dstFile);
-                    
+
                 } else {
-                    
+
                     // just remove the old file if we don't keep backups
                     file.delete();
-                    
+
                 }
-                
+
                 // create new file
                 setDelegatee(createFile());
             }

Modified: incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLoggerFactory.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLoggerFactory.java?rev=652823&r1=652822&r2=652823&view=diff
==============================================================================
--- incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLoggerFactory.java
(original)
+++ incubator/sling/trunk/osgi/log/src/main/java/org/apache/sling/osgi/log/slf4j/SlingLoggerFactory.java
Fri May  2 10:01:41 2008
@@ -19,10 +19,8 @@
 package org.apache.sling.osgi.log.slf4j;
 
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.text.MessageFormat;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -75,7 +73,7 @@
             t.printStackTrace(System.err);
         }
     }
-    
+
     // private constructor to prevent instantiation. This is a singleton class
     private SlingLoggerFactory() {
     }
@@ -86,7 +84,7 @@
      * Returns a logger for the given name. If such a logger already exists the
      * same logger is returned. Otherwise a new instance is created and
      * configured with the current logging level, output and message format.
-     * 
+     *
      * @param name The name of the logger to return
      */
     public Logger getLogger(String name) {
@@ -105,7 +103,7 @@
     /**
      * Configures this factory and all existing loggers with the new log level,
      * output and message format.
-     * 
+     *
      * @param logLevel The log level to be set. If this is not a valid
      *            {@link SlingLoggerLevel} value, the default <code>INFO</code>
      *            is assumed.
@@ -149,7 +147,7 @@
             }
         }
     }
-    
+
     public List<SlingLogger> getLoggerList() {
         synchronized (loggers) {
             return new ArrayList<SlingLogger>(loggers.values());
@@ -167,5 +165,5 @@
         logger.configure(level, output, messageFormat);
         return logger;
     }
-    
+
 }

Modified: incubator/sling/trunk/osgi/log/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/osgi/log/src/main/java/org/slf4j/impl/StaticLoggerBinder.java?rev=652823&r1=652822&r2=652823&view=diff
==============================================================================
--- incubator/sling/trunk/osgi/log/src/main/java/org/slf4j/impl/StaticLoggerBinder.java (original)
+++ incubator/sling/trunk/osgi/log/src/main/java/org/slf4j/impl/StaticLoggerBinder.java Fri
May  2 10:01:41 2008
@@ -19,10 +19,7 @@
 package org.slf4j.impl;
 
 import org.apache.sling.osgi.log.slf4j.SlingLoggerFactory;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MarkerFactory;
 import org.slf4j.ILoggerFactory;
-import org.slf4j.IMarkerFactory;
 import org.slf4j.spi.LoggerFactoryBinder;
 
 /**



Mime
View raw message