1 8 package org.apache.avalon.phoenix.components.manager; 9 10 import mx4j.log.Logger; 11 12 15 public class MX4JLoggerAdapter extends Logger 16 { 17 private static org.apache.avalon.framework.logger.Logger avalonLogger; 18 19 23 public static void setLogger(org.apache.avalon.framework.logger.Logger logger) 24 { 25 avalonLogger = logger; 26 } 27 28 36 protected void log(int level, Object message, Throwable throwable) 37 { 38 switch (level) 39 { 40 case mx4j.log.Logger.DEBUG: 41 avalonLogger.debug(message.toString(), throwable); 42 break; 43 case mx4j.log.Logger.ERROR: 44 avalonLogger.error(message.toString(), throwable); 45 break; 46 case mx4j.log.Logger.FATAL: 47 avalonLogger.fatalError(message.toString(), throwable); 48 break; 49 case mx4j.log.Logger.INFO: 50 avalonLogger.info(message.toString(), throwable); 51 break; 52 case mx4j.log.Logger.TRACE: 53 avalonLogger.debug(message.toString(), throwable); 54 break; 55 case mx4j.log.Logger.WARN: 56 avalonLogger.warn(message.toString(), throwable); 57 break; 58 } 59 } 60 } 61 | Popular Tags |