Skip to content

Commit

Permalink
log optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunrisea committed Nov 25, 2024
1 parent 042db53 commit 3042bf2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,23 @@ private ConfigCacheFactoryDelegate() {
Collection<ConfigCacheFactory> configCacheFactories = NacosServiceLoader.load(ConfigCacheFactory.class);
for (ConfigCacheFactory each : configCacheFactories) {
if (StringUtils.isEmpty(each.getConfigCacheFactoryName())) {
LOGGER.warn("[ConfigCacheFactory] Load ConfigCacheFactory({}) ConfigFactroyName (null/empty) fail. "
+ "Please add ConfigFactoryName to resolve",
each.getClass());
LOGGER.warn(
"[ConfigCacheFactoryDelegate] Load ConfigCacheFactory({}) ConfigFactroyName (null/empty) fail. "
+ "Please add ConfigFactoryName to resolve", each.getClass().getName());
continue;
}
LOGGER.info("[ConfigCacheFactory] Load ConfigCacheFactory({}) ConfigCacheFactoryName({}) successfully. ",
each.getClass(), each.getConfigCacheFactoryName());
LOGGER.info(
"[ConfigCacheFactoryDelegate] Load ConfigCacheFactory({}) ConfigCacheFactoryName({}) successfully. ",
each.getClass().getName(), each.getConfigCacheFactoryName());
if (StringUtils.equals(configCacheFactoryType, each.getConfigCacheFactoryName())) {
LOGGER.info("[ConfigCacheFactoryDelegate] Matched ConfigCacheFactory found,set configCacheFactory={}",
each.getClass().getName());
this.configCacheFactory = each;
}
}
if (this.configCacheFactory == null) {
LOGGER.info(
"[ConfigCacheFactoryDelegate] Matched ConfigCacheFactory not found, Load Default NacosConfigCacheFactory successfully.");
this.configCacheFactory = new NacosConfigCacheFactory();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,24 @@ private ConfigCachePostProcessorDelegate() {
for (ConfigCachePostProcessor processor : processors) {
if (StringUtils.isEmpty(processor.getPostProcessorName())) {
LOGGER.warn(
"[ConfigCachePostProcessor] Load ConfigCachePostProcessor({}) PostProcessorName(null/empty) fail. "
+ "Please add PostProcessorName to resolve",
processor.getClass().getName());
"[ConfigCachePostProcessorDelegate] Load ConfigCachePostProcessor({}) PostProcessorName(null/empty) fail. "
+ "Please add PostProcessorName to resolve", processor.getClass().getName());
continue;
}
LOGGER.info(
"[ConfigCachePostProcessorDelegate] Load ConfigCachePostProcessor({}) PostProcessorName({}) successfully. ",
processor.getClass().getName(), processor.getPostProcessorName());
if (StringUtils.equals(configCacheMd5PostProcessorType, processor.getPostProcessorName())) {
LOGGER.info(
"[ConfigCachePostProcessorDelegate] Matched ConfigCachePostProcessor found,set configCacheFactory={}",
processor.getClass().getName());
this.configCachePostProcessor = processor;
}
}
if (configCachePostProcessor == null) {
LOGGER.info(
"[ConfigCachePostProcessorDelegate] Matched ConfigCachePostProcessor not found, "
+ "load Default NacosConfigCachePostProcessor successfully");
configCachePostProcessor = new NacosConfigCachePostProcessor();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,21 @@ private Md5ComparatorDelegate() {
for (Md5Comparator each : md5Comparators) {
if (StringUtils.isEmpty(each.getMd5ComparatorName())) {
LOGGER.warn(
"[Md5Comparator] Load Md5Comparator({}) Md5ComparatorName(null/empty) fail. Please add Md5ComparatorName to resolve",
"[Md5ComparatorDelegate] Load Md5Comparator({}) Md5ComparatorName(null/empty) fail. Please add Md5ComparatorName to resolve",
each.getClass().getName());
continue;
}
LOGGER.info("[Md5ComparatorDelegate] Load Md5Comparator({}) Md5ComparatorName({}) successfully.",
each.getClass().getName(), each.getMd5ComparatorName());
if (StringUtils.equals(md5ComparatorType, each.getMd5ComparatorName())) {
LOGGER.info("[Md5ComparatorDelegate] Matched Md5Comparator found,set md5Comparator={}",
each.getClass().getName());
md5Comparator = each;
}
}
if (md5Comparator == null) {
LOGGER.info(
"[Md5ComparatorDelegate] Matched Md5Comparator not found, load Default NacosMd5Comparator successfully");
md5Comparator = new NacosMd5Comparator();
}
}
Expand Down

0 comments on commit 3042bf2

Please sign in to comment.