Skip to content

Commit

Permalink
Do not log with warning if no extension found
Browse files Browse the repository at this point in the history
which introduced by apache#1837
eg:

```
    ApplicationConfig applicationConfig = new ApplicationConfig();
    applicationConfig.setName("demo-app");
    applicationConfig.setLogger("slf4j");
```
  • Loading branch information
lonre committed Aug 30, 2019
1 parent 9a9bf2a commit 21ff216
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public <T> T getExtension(Class<T> type, String name) {
}
}

logger.warn("No spring extension (bean) named:" + name + ", try to find an extension (bean) of type " + type.getName());
if (logger.isDebugEnabled()) {
logger.debug("No spring extension (bean) named:" + name + ", try to find an extension (bean) of type " + type.getName());
}

if (Object.class == type) {
return null;
Expand All @@ -101,7 +103,9 @@ public <T> T getExtension(Class<T> type, String name) {
}
}

logger.warn("No spring extension (bean) named:" + name + ", type:" + type.getName() + " found, stop get bean.");
if (logger.isDebugEnabled()) {
logger.debug("No spring extension (bean) named:" + name + ", type:" + type.getName() + " found, stop get bean.");
}

return null;
}
Expand Down

0 comments on commit 21ff216

Please sign in to comment.