loggerにprintf
loggerをprintf形式で使いたくてこんなクラスを書いてみた。
import org.apache.log4j.Logger; public class NLogger { private Logger logger; protected NLogger(String name) { logger = Logger.getLogger(name); } public static NLogger getLogger(Class c){ return new NLogger(c.toString()); } public void debug(String fmt, Object ... args){ logger.debug(String.format(fmt, args)); } }
最近のコメント