[slf4j-dev] svn commit: r841 - in slf4j/trunk/slf4j-converter: jcl src/main/java/org/slf4j/converter

jncharpin at slf4j.org jncharpin at slf4j.org
Wed Jul 11 07:04:20 CEST 2007


Author: jncharpin
Date: Wed Jul 11 07:04:20 2007
New Revision: 841

Added:
   slf4j/trunk/slf4j-converter/jcl/
   slf4j/trunk/slf4j-converter/jcl/jclcontent.java
Modified:
   slf4j/trunk/slf4j-converter/src/main/java/org/slf4j/converter/JCLMatcher.java

Log:
on going work adding jcl sample source code

Added: slf4j/trunk/slf4j-converter/jcl/jclcontent.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/slf4j-converter/jcl/jclcontent.java	Wed Jul 11 07:04:20 2007
@@ -0,0 +1,22 @@
+/**
+*This is not a class, just a sample of some jcl source code to convert
+*/
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
+
+
+Log l = LogFactory.getLog(MyClass.class);
+Log mylog=LogFactory.getLog(MyClass.class);
+Log mylog1 = LogFactory.getLog(MyClass.class);
+Log mylog2  =    LogFactory.getLog(MyClass.class);
+
+Log log3=LogFactory.getFactory().getInstance(MyClass.class);
+Log mylog4 = LogFactory.getFactory().getInstance(MyClass.class);
+Log mylog5 = LogFactory.getLog(MyClass.class);
+
+Log myLog6;
+
+log7=LogFactory.getFactory().getInstance(MyClass.class);
+log8 =LogFactory.getFactory().getInstance(MyClass.class);
+myLog9  =  LogFactory.getLog(MyClass.class);
+

Modified: slf4j/trunk/slf4j-converter/src/main/java/org/slf4j/converter/JCLMatcher.java
==============================================================================
--- slf4j/trunk/slf4j-converter/src/main/java/org/slf4j/converter/JCLMatcher.java	(original)
+++ slf4j/trunk/slf4j-converter/src/main/java/org/slf4j/converter/JCLMatcher.java	Wed Jul 11 07:04:20 2007
@@ -11,8 +11,8 @@
    private static PatternWrapper p1 =  new PatternWrapper("1",Pattern.compile("import\\s*+org.apache.commons.logging.Log;"));
    private static PatternWrapper p2 =  new PatternWrapper("2",Pattern.compile("(Log)(\\s+\\w+\\s*+=\\s*+)(LogFactory.getFactory\\(\\).getInstance\\()(\\w+)(.class\\);)"));
    private static PatternWrapper p3 =  new PatternWrapper("3",Pattern.compile("(Log)(\\s+\\w+\\s*+=\\s*+)(LogFactory.getLog\\()(\\w+)(.class\\);)"));
-   private static PatternWrapper p4 =  new PatternWrapper("4",Pattern.compile("(LogFactory.getFactory\\(\\).getInstance\\()(\\w+)(.class\\);)"));
-   private static PatternWrapper p5 =  new PatternWrapper("5",Pattern.compile("(LogFactory.getLog\\()(\\w+)(.class\\);)"));
+   private static PatternWrapper p4 =  new PatternWrapper("4",Pattern.compile("(\\w+\\s*+=\\s*+)(LogFactory.getFactory\\(\\).getInstance\\()(\\w+)(.class\\);)"));
+   private static PatternWrapper p5 =  new PatternWrapper("5",Pattern.compile("(\\w+\\s*+=\\s*+)(LogFactory.getLog\\()(\\w+)(.class\\);)"));
    private static PatternWrapper p6 =  new PatternWrapper("6",Pattern.compile("(Log)(\\s+(\\w+)\\s*;)"));
 //   private static PatternWrapper p8 = new PatternWrapper("8",Pattern.compile("fatal\\("));
 //   private static PatternWrapper p9 = new PatternWrapper("9",Pattern.compile("isFatalEnabled\\("));
@@ -23,7 +23,7 @@
    static{
 	   r2.addReplacement("3", "LoggerFactory.getLogger(");
    }
-   private static ReplacementWrapper r3 = new ReplacementWrapper("1","LoggerFactory.getLogger(");
+   private static ReplacementWrapper r3 = new ReplacementWrapper("2","LoggerFactory.getLogger(");
    private static ReplacementWrapper r4 = new ReplacementWrapper("1", "Logger");
    
    



More information about the slf4j-dev mailing list