1 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 21 public class MockReader implements LogConfigurationReader { 22 23 24 public MockReader() { 25 } 26 27 public LogConfiguration parseConfiguration(String 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 |