DATACMNS-1755 - Consistently use commons-logging.

Replace the few occurrences where SLF4J was being used directly so that
all logging now happens via commons-logging. The log patterns used in
SLF4J messages have been replaced with `LogMessage` which was introduced
in Spring Framework 5.2.

Original pull request: #448.
This commit is contained in:
Phillip Webb
2020-06-09 11:13:27 -07:00
committed by Mark Paluch
parent b225acd22d
commit 67442077b7
15 changed files with 86 additions and 65 deletions

View File

@@ -27,9 +27,11 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.slf4j.Logger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.core.log.LogMessage;
import org.springframework.core.type.MethodMetadata;
import org.springframework.data.type.MethodsMetadata;
import org.springframework.data.type.classreading.MethodsMetadataReader;
@@ -130,7 +132,7 @@ class DefaultProjectionInformation implements ProjectionInformation {
*/
private static class PropertyDescriptorSource {
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(PropertyDescriptorSource.class);
private static final Log logger = LogFactory.getLog(PropertyDescriptorSource.class);
private final Class<?> type;
private final Optional<MethodsMetadata> metadata;
@@ -237,8 +239,7 @@ class DefaultProjectionInformation implements ProjectionInformation {
} catch (IOException e) {
logger.info("Couldn't read class metadata for {}. Input property calculation might fail!", type);
logger.info(LogMessage.format("Couldn't read class metadata for %s. Input property calculation might fail!", type));
return Optional.empty();
}
}