public static ClassLogger get(@Nullable Logger parent, Class<?> klass, @Nullable String instanceKey) {
if(parent == null) {
parent = Logger.getLogger("");
}
ClassLogger logger = find(parent, klass, instanceKey);
if(logger == null) {
logger = new ClassLogger(parent, klass, instanceKey);
// TODO: call addLogger from the constructuor, when it's no longer public
final LogManager logManager = LogManager.getLogManager();
if(logManager.addLogger(logger)) {
// addLogger will set the parent, so we have to set it back again
logger.setParent(parent);
} else {
// Logger was created by another thread
logger = find(parent, klass, instanceKey);
if(logger == null) {
throw new IllegalStateException("Failed to register logger " + getName(klass, instanceKey));
}
}
}
return logger;
}
ClassLogger.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:ProjectAres
作者:
评论列表
文章目录