1 16 17 package org.springframework.ui.velocity; 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 import org.apache.velocity.app.VelocityEngine; 22 import org.apache.velocity.runtime.RuntimeServices; 23 import org.apache.velocity.runtime.log.LogSystem; 24 25 33 public class CommonsLoggingLogSystem implements LogSystem { 34 35 private static final Log logger = LogFactory.getLog(VelocityEngine.class); 36 37 public void init(RuntimeServices runtimeServices) { 38 } 39 40 public void logVelocityMessage(int type, String msg) { 41 switch (type) { 42 case ERROR_ID: 43 logger.error(msg); 44 break; 45 case WARN_ID: 46 logger.warn(msg); 47 break; 48 case INFO_ID: 49 logger.info(msg); 50 break; 51 case DEBUG_ID: 52 logger.debug(msg); 53 break; 54 } 55 } 56 57 } 58 | Popular Tags |