码迷,mamicode.com
首页 > 其他好文 > 详细

Logger.getLogger(*.class)源码分析

时间:2015-09-29 12:55:23      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

//补偿:http://blog.csdn.net/anlina_1984/article/details/5313023
//方法 protected static Logger logger = Logger.getLogger(PropertiesConfigLocalLoader.class); //进去这个 package org.apache.log4j; public class Logger extends Category { //只列出这个静态方法 static public Logger getLogger(Class clazz) { return LogManager.getLogger(clazz.getName()); } } //进去这个 public class LogManager { //又只列出这一个静态方法 public static Logger getLogger(Class clazz) { // Delegate the actual manufacturing of the logger to the logger repository. return repositorySelector.getLoggerRepository().getLogger(clazz.getName()); } } //进去这个 //卧槽一个接口,内容只有这么多 package org.apache.log4j.spi; public interface RepositorySelector { /** Returns a {@link LoggerRepository} depending on the context. Implementors must make sure that a valid (non-null) LoggerRepository is returned. */ public LoggerRepository getLoggerRepository(); } //进去这个 //卧槽,又是接口 package org.apache.log4j.spi; public interface LoggerRepository { //就这样完结了 public Logger getLogger(String name); } //然后呢?不明白

  

 

Logger.getLogger(*.class)源码分析

标签:

原文地址:http://www.cnblogs.com/nima/p/4845976.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!