[LOGBack-dev] svn commit: r386 - in logback/classic/trunk: . anakia-lib examples examples/src examples/src/chapter1 src/main/java/ch/qos/logback/classic src/main/java/ch/qos/logback/classic/examples src/site/xdocTemplates src/test/java/ch/qos/logback/classic/control src/test/java/ch/qos/logback/classic/joran

noreply.ceki at qos.ch noreply.ceki at qos.ch
Mon Jul 31 20:13:11 CEST 2006


Author: ceki
Date: Mon Jul 31 20:12:57 2006
New Revision: 386

Added:
   logback/classic/trunk/anakia-lib/
   logback/classic/trunk/anakia-lib/ant-1.4.1.jar   (contents, props changed)
   logback/classic/trunk/anakia-lib/commons-collections-2.0.jar   (contents, props changed)
   logback/classic/trunk/anakia-lib/jdom-b8.jar   (contents, props changed)
   logback/classic/trunk/anakia-lib/log4j-1.1.3.jar   (contents, props changed)
   logback/classic/trunk/anakia-lib/velocity-1.4-dev.jar   (contents, props changed)
   logback/classic/trunk/anakia-lib/velocity-1.4.jar   (contents, props changed)
   logback/classic/trunk/anakia-lib/xerces-1.4.4.jar   (contents, props changed)
   logback/classic/trunk/examples/
   logback/classic/trunk/examples/src/
   logback/classic/trunk/examples/src/chapter1/
   logback/classic/trunk/examples/src/chapter1/BabySteps1.java
      - copied, changed from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps1.java
   logback/classic/trunk/examples/src/chapter1/BabySteps2.java
      - copied, changed from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps2.java
   logback/classic/trunk/examples/src/chapter1/BabySteps3.java
      - copied, changed from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps3.java
   logback/classic/trunk/examples/src/chapter1/MyApp.java
      - copied, changed from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/MyApp.java
   logback/classic/trunk/site.xml
Removed:
   logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/
Modified:
   logback/classic/trunk/pom.xml
   logback/classic/trunk/src/main/java/ch/qos/logback/classic/PatternLayout.java
   logback/classic/trunk/src/site/xdocTemplates/shortIntro.xml
   logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/ControlLoggerContext.java
   logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/Scenario.java
   logback/classic/trunk/src/test/java/ch/qos/logback/classic/joran/BasicJoranTest.java
Log:

- added anakia-lib directory for faster site builds
- moved examples to examples/src directory. They shoould not be part of the main build
- small changes correcting type safety issues

Added: logback/classic/trunk/anakia-lib/ant-1.4.1.jar
==============================================================================
Binary file. No diff available.

Added: logback/classic/trunk/anakia-lib/commons-collections-2.0.jar
==============================================================================
Binary file. No diff available.

Added: logback/classic/trunk/anakia-lib/jdom-b8.jar
==============================================================================
Binary file. No diff available.

Added: logback/classic/trunk/anakia-lib/log4j-1.1.3.jar
==============================================================================
Binary file. No diff available.

Added: logback/classic/trunk/anakia-lib/velocity-1.4-dev.jar
==============================================================================
Binary file. No diff available.

Added: logback/classic/trunk/anakia-lib/velocity-1.4.jar
==============================================================================
Binary file. No diff available.

Added: logback/classic/trunk/anakia-lib/xerces-1.4.4.jar
==============================================================================
Binary file. No diff available.

Copied: logback/classic/trunk/examples/src/chapter1/BabySteps1.java (from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps1.java)
==============================================================================
--- logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps1.java	(original)
+++ logback/classic/trunk/examples/src/chapter1/BabySteps1.java	Mon Jul 31 20:12:57 2006
@@ -1,14 +1,13 @@
-package ch.qos.logback.classic.examples;
+package chapter1;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class BabySteps1 {
 
-	final static Logger logger = LoggerFactory.getLogger(BabySteps1.class);
-
 	public static void main(String[] args) {
 
+    Logger logger = LoggerFactory.getLogger(BabySteps1.class);
 		logger.debug("Hello world.");
 
 	}

Copied: logback/classic/trunk/examples/src/chapter1/BabySteps2.java (from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps2.java)
==============================================================================
--- logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps2.java	(original)
+++ logback/classic/trunk/examples/src/chapter1/BabySteps2.java	Mon Jul 31 20:12:57 2006
@@ -1,4 +1,4 @@
-package ch.qos.logback.classic.examples;
+package chapter1;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -7,10 +7,10 @@
 
 public class BabySteps2 {
 
-	final static Logger logger = LoggerFactory.getLogger(BabySteps1.class);
-
 	public static void main(String[] args) {
 
+    Logger logger = LoggerFactory.getLogger(BabySteps1.class);
+    
 		logger.debug("Hello world.");
 		LoggerStatusPrinter.printStatusInDefaultContext();
 

Copied: logback/classic/trunk/examples/src/chapter1/BabySteps3.java (from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps3.java)
==============================================================================
--- logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/BabySteps3.java	(original)
+++ logback/classic/trunk/examples/src/chapter1/BabySteps3.java	Mon Jul 31 20:12:57 2006
@@ -1,4 +1,4 @@
-package ch.qos.logback.classic.examples;
+package chapter1;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -8,9 +8,10 @@
 
 public class BabySteps3 {
 
-	final static Logger logger = LoggerFactory.getLogger(BabySteps1.class);
-
+	
 	public static void main(String[] args) {
+    
+    Logger logger = LoggerFactory.getLogger(BabySteps1.class);
 
 		BasicConfigurator.configureDefaultContext();
 		logger.debug("Hello world.");

Copied: logback/classic/trunk/examples/src/chapter1/MyApp.java (from r385, logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/MyApp.java)
==============================================================================
--- logback/classic/trunk/src/main/java/ch/qos/logback/classic/examples/MyApp.java	(original)
+++ logback/classic/trunk/examples/src/chapter1/MyApp.java	Mon Jul 31 20:12:57 2006
@@ -1,6 +1,6 @@
-package ch.qos.logback.classic.examples;
+package chapter1;
 
-// Import logback classes.
+// Import SLF4J classes.
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -25,7 +25,7 @@
 }
 
 class Bar {
-	static Logger logger = LoggerFactory.getLogger(Bar.class);
+	Logger logger = LoggerFactory.getLogger(Bar.class);
 	public void doIt() {
 		logger.debug("doing my job");
 	}

Modified: logback/classic/trunk/pom.xml
==============================================================================
--- logback/classic/trunk/pom.xml	(original)
+++ logback/classic/trunk/pom.xml	Mon Jul 31 20:12:57 2006
@@ -9,8 +9,8 @@
 	<artifactId>logback-classic</artifactId>
 	<packaging>jar</packaging>
 	<version>0.2-SNAPSHOT</version>
-	<name>Logback Classic Module</name>
-
+	<name>Logback Classic Module</name>
+
 	<url>http://logback.qos.ch/classic</url>
 	<description>
 		<!-- 
@@ -27,12 +27,12 @@
 	</organization>
 	<inceptionYear>2005</inceptionYear>
 	
-	<dependencies>
-		<dependency>
-			<groupId>ch.qos.logback</groupId>
-			<artifactId>logback-core</artifactId>
+	<dependencies>
+		<dependency>
+			<groupId>ch.qos.logback</groupId>
+			<artifactId>logback-core</artifactId>
 			<version>0.2-SNAPSHOT</version>
-			<scope>compile</scope>
+			<scope>compile</scope>
 		</dependency>
 
 		<dependency>
@@ -48,7 +48,7 @@
 			<artifactId>junit</artifactId>
 			<version>3.8.1</version>
 			<scope>test</scope>
-		</dependency>
+		</dependency>
 	</dependencies>
 
 	<build>
@@ -140,7 +140,8 @@
 					</xdocDirectory>
 				</configuration>
 			</plugin>
-			<!-- plugin>
+
+			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>
 					maven-project-info-reports-plugin
@@ -152,7 +153,8 @@
 						</reports>
 					</reportSet>
 				</reportSets>
-			</plugin -->
+			</plugin>
+
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
@@ -184,5 +186,5 @@
 			<id>pixie</id>
 			<url>scp://pixie/var/www/logback.qos.ch/htdocs/classic</url>
 		</site>
-	</distributionManagement>
+	</distributionManagement>
 </project>
\ No newline at end of file

Added: logback/classic/trunk/site.xml
==============================================================================
--- (empty file)
+++ logback/classic/trunk/site.xml	Mon Jul 31 20:12:57 2006
@@ -0,0 +1,71 @@
+
+<project name="logback-classic-site" default="site" basedir="." >
+
+
+  <!-- The build.properties file defines the parth to local jar files -->
+  <property file="build.properties"/>
+
+  <!-- The base directory relative to which most targets are built -->
+  <property name="base" value="."/>
+
+  <!-- Destination for documentation files -->
+  <property name="docs.dest" value="./target/site"/>
+
+  <!-- Source directory for xml docs -->
+  <property name="xdocs.src" value="./src/site/xdocTemplates/"/>
+
+  <!-- Construct classpath for building the html pages-->
+  <path id="site.classpath">
+    <fileset dir="./anakia-lib">
+      <include name="*.jar"/>
+    </fileset>
+  </path>
+
+
+  <!-- ================================================================= -->
+  <!-- Default target                                                    -->
+  <!-- ================================================================= -->
+
+  <target name="usage">
+    <echo>
+
+    These are the targets supported by this ANT build scpript:
+
+    site     - build LOGBACK CLASSIC web-site
+    </echo>
+  </target>
+
+  <!-- ============================================== -->
+  <!-- Build the site files using Anakia              -->
+  <!-- ============================================== -->
+  <target name="prepareSite">
+    <available classname="org.apache.velocity.anakia.AnakiaTask"
+      property="AnakiaTask.present">
+      <classpath refid="site.classpath"/>
+    </available>
+  </target>
+
+  <target name="checkSite" depends="prepareSite" unless="AnakiaTask.present">
+    <echo>
+      AnakiaTask is not present! Please check to make sure that
+      velocity.jar is in your classpath.
+    </echo>
+  </target>
+
+  <target name="site" depends="checkSite" if="AnakiaTask.present">
+    <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
+      <classpath refid="site.classpath"/>
+    </taskdef>
+
+    <anakia basedir="${xdocs.src}" destdir="${docs.dest}/"
+      extension=".html"
+      style="site.vm"
+      projectFile="stylesheets/project.xml"
+      excludes="**/stylesheets/**"
+      includes="**/*.xml"
+      lastModifiedCheck="true"
+      templatePath="./stylesheets">
+    </anakia>
+  </target>
+</project>
+

Modified: logback/classic/trunk/src/main/java/ch/qos/logback/classic/PatternLayout.java
==============================================================================
--- logback/classic/trunk/src/main/java/ch/qos/logback/classic/PatternLayout.java	(original)
+++ logback/classic/trunk/src/main/java/ch/qos/logback/classic/PatternLayout.java	Mon Jul 31 20:12:57 2006
@@ -115,7 +115,7 @@
     setContextForConverters(head);
   }
 
-  public Map getDefaultConverterMap() {
+  public Map<String, String> getDefaultConverterMap() {
     return defaultConverterMap;
   }
 

Modified: logback/classic/trunk/src/site/xdocTemplates/shortIntro.xml
==============================================================================
--- logback/classic/trunk/src/site/xdocTemplates/shortIntro.xml	(original)
+++ logback/classic/trunk/src/site/xdocTemplates/shortIntro.xml	Mon Jul 31 20:12:57 2006
@@ -9,9 +9,7 @@
 
 
 	<body>
-		<div class="section">
-			<h2>Short introduction</h2>
-		</div>
+    <h2>Short introduction</h2>
 		<div class="author">
 			Authors: Ceki G&#252;lc&#252;, S&#233;bastien Pennec
 		</div>
@@ -44,9 +42,8 @@
 			</tr>
 		</table>
 
-		<div class="section">
-			<h2>Introduction</h2>
-		</div>
+    <h2>Introduction</h2>
+
 		<p>
 			Logging is a low-tech way of debugging your code. It might
 			also be the only way, when debuggers are not available or
@@ -68,57 +65,53 @@
 			work.
 		</p>
 
-		<div class="section">
-			<h2>Logback architecture</h2>
+    <h2>Logback architecture</h2>
 
-			<p>
-				Logback's basic architecture is sufficiently generic so
-				as to apply under different circumstances. At present
-				time, logback is divided into three modules, Core,
-				Classic and Access.
-			</p>
-			<p>
-				The Core module lays the groundwork for the other two
-				modules. The Classic module extends the core module, it
-				can be assimilated to an improved version of log4j.
-				Logback Classic natively implements the SLF4J API so
-				that you can readily switch back and forth between
-				logback and other logging systems such as log4j or JDK14
-				Logging. The Access module also extends the core
-				functionnalities and integrates with Servlet containers
-				to provide HTPP-access log functionality.
-			</p>
-			<p>
-				Note that you can easily build your own modules on top
-				of the Core module.
-			</p>
-		</div>
-
-		<div class="section">
-			<h2>First Baby Steps</h2>
-		</div>
-		<p>
-		After you have added the logback classic jar to your classpath, 
-		you can test a small program that uses its functionalities.
+    <p>
+				Logback's basic architecture is sufficiently generic so as to
+				apply under different circumstances. At present time, logback
+				is divided into three modules, Core, Classic and Access.
+    </p>
+		
+    <p>The Core module lays the groundwork for the other two
+    modules. The Classic module extends the core module, it can be
+    assimilated to an improved version of log4j.  Logback Classic
+    natively implements the SLF4J API so that you can readily switch
+    back and forth between logback and other logging systems such as
+    log4j or JDK14 Logging. The Access module also extends the core
+    functionnalities and integrates with Servlet containers to provide
+    HTPP-access log functionality.
+    </p>
+    
+    <p>Note that you can easily build your own modules on top of the
+    Core module.
+    </p>
+
+    <h2>First Baby Steps</h2>
+
+    <p> After you have added the jar fiiles <em>logback-core.jar</em>
+    and <em>logback-classic.jar</em> to your classpath, you can start
+    testing a small program that uses logback.
 		</p>
 
 <div class="source">
-package ch.qos.logback.classic.examples;
+package chapter1;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class BabySteps1 {
 
-  final static Logger logger = LoggerFactory.getLogger(BabySteps1.class);
 
   public static void main(String[] args) {
 
+    Logger logger = LoggerFactory.getLogger(BabySteps1.class);
     logger.debug("Hello world.");
 
   }
 }
 </div>
+
 		<p>
 			This is the basic, yet usual way of using logback classic. 
 			It starts by importing the Logger and LoggerFactory from SLF4J. 
@@ -254,9 +247,8 @@
 			of logback.
 		</p>
 
-		<div class="section">
-			<h3>Logger hierarchy</h3>
-		</div>
+    <h3>Logger hierarchy</h3>
+
 		<p>
 			The first and foremost advantage of any logging API over
 			plain System.out.println resides in its ability to disable
@@ -699,9 +691,7 @@
 			located seems to be the best strategy known so far.
 		</p>
 
-		<div class="section">
-			<h3>Appenders and Layouts</h3>
-		</div>
+    <h3>Appenders and Layouts</h3>
 
 		<p>
 			The ability to selectively enable or disable logging
@@ -980,9 +970,8 @@
 
 		<div class="source">logger.debug("Value {} was inserted between {} and {}.", new Object[] {newVal, below, above});</div>
 
-		<div class="section">
-			<h3>Configuration</h3>
-		</div>
+    <h3>Configuration</h3>
+
 		<p>
 			Inserting log requests into the application code requires 
 			a fair amount of planning and effort. Observation shows that 

Modified: logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/ControlLoggerContext.java
==============================================================================
--- logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/ControlLoggerContext.java	(original)
+++ logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/ControlLoggerContext.java	Mon Jul 31 20:12:57 2006
@@ -33,7 +33,7 @@
   private ControlLogger root;
   //
   // Hashtable loggerMap = new Hashtable();
-   Map loggerMap = new HashMap();
+   Map<String, ControlLogger> loggerMap = new HashMap<String, ControlLogger>();
    
   public ControlLoggerContext() {
     this.root = new ControlLogger("root", null);

Modified: logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/Scenario.java
==============================================================================
--- logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/Scenario.java	(original)
+++ logback/classic/trunk/src/test/java/ch/qos/logback/classic/control/Scenario.java	Mon Jul 31 20:12:57 2006
@@ -14,7 +14,6 @@
 import java.util.Vector;
 
 import ch.qos.logback.classic.Level;
-import ch.qos.logback.core.joran.action.Action;
 
 public class Scenario {
   // the frequency of a set levelInt event for every create logger event

Modified: logback/classic/trunk/src/test/java/ch/qos/logback/classic/joran/BasicJoranTest.java
==============================================================================
--- logback/classic/trunk/src/test/java/ch/qos/logback/classic/joran/BasicJoranTest.java	(original)
+++ logback/classic/trunk/src/test/java/ch/qos/logback/classic/joran/BasicJoranTest.java	Mon Jul 31 20:12:57 2006
@@ -48,7 +48,6 @@
     StatusPrinter.print(loggerContext.getStatusManager());
   
     Logger logger = loggerContext.getLogger(this.getClass().getName());
-    Logger root = loggerContext.getRootLogger();
     String msg = "hello world";
     logger.debug("toto");
     logger.debug(msg);



More information about the logback-dev mailing list