1 23 24 package org.objectweb.medor.expression; 25 26 import junit.framework.TestCase; 27 import org.objectweb.util.monolog.api.Logger; 28 import org.objectweb.util.monolog.api.LoggerFactory; 29 import org.objectweb.util.monolog.Monolog; 30 31 34 35 public class TestLogHelper extends TestCase { 36 37 public static boolean isOn; 38 public Logger logger; 39 static LoggerFactory loggerFactory; 40 41 public TestLogHelper(String n) { 42 super(n); 43 logger = getLoggerFactory().getLogger("org.objectweb.medor.expression"); 44 } 45 46 public TestLogHelper(String testName, String loggerName) { 47 super(testName); 48 logger = getLoggerFactory().getLogger(loggerName); 49 } 50 51 public void changeLogger(String loggerName) { 52 logger = getLoggerFactory().getLogger(loggerName); 53 } 54 55 public static LoggerFactory getLoggerFactory() { 56 if (loggerFactory == null 57 || loggerFactory == Monolog.getDefaultMonologFactory()) { 58 loggerFactory = Monolog.initialize(); 59 } 60 return loggerFactory; 61 } 62 } 63 | Popular Tags |