输出两条打印结果,不理解,哪个大神给分析下原因

 

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

 

posted @ 2015-01-22 19:10  沧海一滴  阅读(213)  评论(0编辑  收藏  举报