1 package org.grlea.log.test.commons; 2 3 6 18 import org.grlea.log.SimpleLog; 19 import org.grlea.log.SimpleLogger; 20 21 import org.apache.commons.logging.LogFactory; 22 import org.apache.commons.logging.Log; 23 24 30 public class 31 SimpleCommonsLoggingClass 32 { 33 private final Log log; 34 35 public 36 SimpleCommonsLoggingClass() 37 { 38 log = LogFactory.getLog(getClass()); 39 } 40 41 public 42 SimpleCommonsLoggingClass(String loggerName) 43 { 44 log = LogFactory.getLog(loggerName); 45 } 46 47 public Log 48 getLog() 49 { 50 return log; 51 } 52 53 public void 54 doSomeLogging() 55 { 56 log.fatal("Test of Fatal"); 57 log.error("Test of Error"); 58 log.warn("Test of Warn"); 59 log.info("Test of Info"); 60 log.debug("Test of Debug"); 61 log.trace("Test of Trace"); 62 } 63 64 public void 65 doSomeTracing() 66 { 67 log.trace("IN: doSomeTracing()"); 68 log.trace("OUT: doSomeTracing()"); 69 } 70 71 public void 72 logAnError() 73 { 74 log.info("Test of Exception", new Throwable ("Test Message")); 75 } 76 } | Popular Tags |