输出两条打印结果,不理解,哪个大神给分析下原因
import org.apache.log4j.Logger; public class InnerClassLogger { static Logger loggerA = Logger.getLogger(InnerClassLogger.class); public static void main(String[] args) { loggerA.info(new Object(){ @Override public String toString(){ loggerA.info("loggerB"); return ""; } }); } }
输出:
0 [main] INFO InnerClassLogger - loggerB
0 [main] INFO InnerClassLogger - loggerB