Add logger.isInfoEnabled check before logger.info

Closes gh-24667
This commit is contained in:
Qimiao Chen 2020-03-10 21:41:20 +08:00 committed by GitHub
parent 018ba92214
commit b92515bdee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
return getSingletonInstance();
}
else {
if (this.targetName == null) {
if (this.targetName == null && logger.isInfoEnabled()) {
logger.info("Using non-singleton proxies with singleton targets is often undesirable. " +
"Enable prototype proxies by setting the 'targetName' property.");
}