1 package com.calipso.reportgenerator.common; 2 3 import org.apache.commons.logging.Log; 4 5 8 public class ReportManagerLogger { 9 private static Log log; 10 11 public static Log getLog() { 12 return log; 13 } 14 15 public static void setLog(Log log) { 16 ReportManagerLogger.log = log; 17 } 18 19 public static boolean isLogEnabled(){ 20 return (log != null); 21 } 22 23 public static void trace(Object o) { 24 if (isLogEnabled()){ 25 log.trace(o); 26 } 27 } 28 29 public static void trace(Object o, Throwable throwable) { 30 if (isLogEnabled()){ 31 log.trace(o,throwable); 32 } 33 } 34 35 public static void debug(Object o) { 36 if (isLogEnabled()){ 37 log.debug(o); 38 } 39 } 40 41 public static void debug(Object o, Throwable throwable) { 42 if (isLogEnabled()){ 43 log.debug(o,throwable); 44 } 45 } 46 47 public static void info(Object o) { 48 if (isLogEnabled()){ 49 log.info(o); 50 } 51 } 52 53 public static void info(Object o, Throwable throwable) { 54 if (isLogEnabled()){ 55 log.info(o,throwable); 56 } 57 } 58 59 public static void warn(Object o) { 60 if (isLogEnabled()){ 61 log.warn(o); 62 } 63 } 64 65 public static void warn(Object o, Throwable throwable) { 66 if (isLogEnabled()){ 67 log.warn(o,throwable); 68 } 69 } 70 71 public static void error(Object o) { 72 if (isLogEnabled()){ 73 log.error(o); 74 } 75 } 76 77 public static void error(Object o, Throwable throwable) { 78 if (isLogEnabled()){ 79 log.error(o,throwable); 80 } 81 } 82 83 public static void fatal(Object o) { 84 if (isLogEnabled()){ 85 log.fatal(o); 86 } 87 } 88 89 public static void fatal(Object o, Throwable throwable) { 90 if (isLogEnabled()){ 91 log.fatal(o,throwable); 92 } 93 } 94 } 95 | Popular Tags |