import java.util.logging.Logger; ……… Logger logimport java.util.logging.Logger; ……… Logger log=Logger.getLogger(A.class.getName()); log.debug(msg); 它说the method debug(String) is undefined for the type Logger debug下面有波浪线.
问题描述:
import java.util.logging.Logger; ……… Logger log
import java.util.logging.Logger; ……… Logger log=Logger.getLogger(A.class.getName()); log.debug(msg); 它说the method debug(String) is undefined for the type Logger debug下面有波浪线.
答
楼主定义log需要用到工厂模式定义
Log log = LogFactory.getLog(A.class);
这样修改就行了
答
把
import java.util.logging.Logger
换成试试
import org.apache.log4j.Logger;