KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > reader > MockReader


1 /*
2  * MockReader.java
3  *
4  * Created on 25. November 2002, 23:07
5  */

6
7 package org.jzonic.jlo.reader;
8
9 import org.jzonic.jlo.LogConfiguration;
10 import org.jzonic.jlo.LogGenerator;
11 import org.jzonic.jlo.Logger;
12 import org.jzonic.jlo.Target;
13 import org.jzonic.jlo.formatter.Formatter;
14 import org.jzonic.jlo.formatter.SimpleFormatter;
15 import org.jzonic.jlo.handler.Handler;
16 import org.jzonic.jlo.handler.MockHandler;
17 /**
18  *
19  * @author Administrator
20  */

21 public class MockReader implements LogConfigurationReader {
22     
23     /** Creates a new instance of MockReader */
24     public MockReader() {
25     }
26     
27     public LogConfiguration parseConfiguration(String JavaDoc name) throws ReaderException {
28         LogConfiguration lc = new LogConfiguration("Test");
29         Handler handler = new MockHandler("Test");
30         Formatter simpleFormatter = new SimpleFormatter("Test");
31         LogGenerator lg = new LogGenerator("org.jzonic.jlo", handler, simpleFormatter);
32         Logger logger = new Logger("org.jzonic.jlo", Target.parse("ALL"),"Test");
33         logger.addLogGenerator(lg);
34         lc.addLogger( logger );
35         Logger seclogger = new Logger("org.jzonic", Target.parse("ALL,!INIT"),"Test");
36         seclogger.addLogGenerator(lg);
37         lc.addLogger( seclogger );
38         Logger thirdlogger = new Logger("org", Target.parse("INIT,FATAL"),"Test");
39         thirdlogger.addLogGenerator(lg);
40         lc.addLogger( thirdlogger );
41         return lc;
42     }
43 }
44
Popular Tags