Example usage for org.springframework.core.codec Hints isLoggingSuppressed

List of usage examples for org.springframework.core.codec Hints isLoggingSuppressed

Introduction

In this page you can find the example usage for org.springframework.core.codec Hints isLoggingSuppressed.

Prototype

public static boolean isLoggingSuppressed(@Nullable Map<String, Object> hints) 

Source Link

Document

Whether to suppress logging based on the hint #SUPPRESS_LOGGING_HINT .

Usage

From source file:org.springframework.http.codec.ResourceHttpMessageWriter.java

private static MediaType getResourceMediaType(@Nullable MediaType mediaType, Resource resource,
        Map<String, Object> hints) {

    if (mediaType != null && mediaType.isConcrete() && !mediaType.equals(MediaType.APPLICATION_OCTET_STREAM)) {
        return mediaType;
    }//ww w . j  av  a 2  s .  co m
    mediaType = MediaTypeFactory.getMediaType(resource).orElse(MediaType.APPLICATION_OCTET_STREAM);
    if (logger.isDebugEnabled() && !Hints.isLoggingSuppressed(hints)) {
        logger.debug(Hints.getLogPrefix(hints) + "Resource associated with '" + mediaType + "'");
    }
    return mediaType;
}