Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#noissue] Check logger is debug enabled #10587

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

public class ExposePathWithinMappingInterceptor implements AroundInterceptor {
private final PLogger logger = PLoggerFactory.getLogger(getClass());
private final boolean isDebug = logger.isDebugEnabled();

Check warning on line 16 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ExposePathWithinMappingInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ExposePathWithinMappingInterceptor.java#L16

Added line #L16 was not covered by tests
private final TraceContext traceContext;
private final Boolean uriStatCollectMethod;

Expand All @@ -35,7 +36,11 @@
try {
final SpanRecorder spanRecorder = trace.getSpanRecorder();
final String url = ArrayArgumentUtils.getArgument(args, 0, String.class);
logger.debug("Attempt recording URI with template: {}", url);

if (isDebug) {
logger.debug("Attempt recording URI with template: {}", url);

Check warning on line 41 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ExposePathWithinMappingInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ExposePathWithinMappingInterceptor.java#L41

Added line #L41 was not covered by tests
}

if (StringUtils.hasLength(url)) {
spanRecorder.recordUriTemplate(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

public class LookupHandlerMethodInterceptor implements AroundInterceptor {
private final PLogger logger = PLoggerFactory.getLogger(getClass());
private final boolean isDebug = logger.isDebugEnabled();

Check warning on line 19 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/LookupHandlerMethodInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/LookupHandlerMethodInterceptor.java#L19

Added line #L19 was not covered by tests
private final TraceContext traceContext;
private final Boolean uriStatCollectMethod;

Expand All @@ -41,7 +42,11 @@
final SpanRecorder spanRecorder = trace.getSpanRecorder();

final String uri = ServletRequestAttributeUtils.extractAttribute(request, SpringWebMvcConstants.SPRING_MVC_DEFAULT_URI_ATTRIBUTE_KEYS);
logger.debug("Attempt recording URI with template: {}", uri);

if (isDebug) {
logger.debug("Attempt recording URI with template: {}", uri);

Check warning on line 47 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/LookupHandlerMethodInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/LookupHandlerMethodInterceptor.java#L47

Added line #L47 was not covered by tests
}

if (StringUtils.hasLength(uri)) {
spanRecorder.recordUriTemplate(uri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

public class ProcessRequestInterceptor implements AroundInterceptor {
private final PLogger logger = PLoggerFactory.getLogger(getClass());
private final boolean isDebug = logger.isDebugEnabled();

Check warning on line 17 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ProcessRequestInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ProcessRequestInterceptor.java#L17

Added line #L17 was not covered by tests
private final TraceContext traceContext;
private final Boolean uriStatUseUserInput;

Expand Down Expand Up @@ -41,7 +42,11 @@
final ServletRequest request = ArrayArgumentUtils.getArgument(args, 0, ServletRequest.class);
if (request != null) {
final String uri = ServletRequestAttributeUtils.extractAttribute(request, SpringWebMvcConstants.SPRING_MVC_URI_USER_INPUT_ATTRIBUTE_KEYS);
logger.debug("Attempt recording URI with template: {}", uri);

if (isDebug) {
logger.debug("Attempt recording URI with template: {}", uri);

Check warning on line 47 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ProcessRequestInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/jakarta/interceptor/ProcessRequestInterceptor.java#L47

Added line #L47 was not covered by tests
}

if (StringUtils.hasLength(uri)) {
final SpanRecorder spanRecorder = trace.getSpanRecorder();
spanRecorder.recordUriTemplate(uri, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

public class ExposePathWithinMappingInterceptor implements AroundInterceptor {
private final PLogger logger = PLoggerFactory.getLogger(getClass());
private final boolean isDebug = logger.isDebugEnabled();

Check warning on line 15 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ExposePathWithinMappingInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ExposePathWithinMappingInterceptor.java#L15

Added line #L15 was not covered by tests
private final TraceContext traceContext;
private final Boolean uriStatCollectMethod;

Expand All @@ -34,7 +35,11 @@
try {
final SpanRecorder spanRecorder = trace.getSpanRecorder();
final String url = ArrayArgumentUtils.getArgument(args, 0, String.class);
logger.debug("Attempt recording URI with template: {}", url);

if (isDebug) {
logger.debug("Attempt recording URI with template: {}", url);

Check warning on line 40 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ExposePathWithinMappingInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ExposePathWithinMappingInterceptor.java#L40

Added line #L40 was not covered by tests
}

if (StringUtils.hasLength(url)) {
spanRecorder.recordUriTemplate(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

public class LookupHandlerMethodInterceptor implements AroundInterceptor {
private final PLogger logger = PLoggerFactory.getLogger(getClass());
private final boolean isDebug = logger.isDebugEnabled();

Check warning on line 18 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/LookupHandlerMethodInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/LookupHandlerMethodInterceptor.java#L18

Added line #L18 was not covered by tests
private final TraceContext traceContext;
private final Boolean uriStatCollectMethod;

Expand All @@ -40,7 +41,11 @@
final SpanRecorder spanRecorder = trace.getSpanRecorder();

final String uri = ServletRequestAttributeUtils.extractAttribute(request, SpringWebMvcConstants.SPRING_MVC_DEFAULT_URI_ATTRIBUTE_KEYS);
logger.debug("Attempt recording URI with template: {}", uri);

if (isDebug) {
logger.debug("Attempt recording URI with template: {}", uri);

Check warning on line 46 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/LookupHandlerMethodInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/LookupHandlerMethodInterceptor.java#L46

Added line #L46 was not covered by tests
}

if (StringUtils.hasLength(uri)) {
spanRecorder.recordUriTemplate(uri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

public class ProcessRequestInterceptor implements AroundInterceptor {
private final PLogger logger = PLoggerFactory.getLogger(getClass());
private final boolean isDebug = logger.isDebugEnabled();

Check warning on line 17 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ProcessRequestInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ProcessRequestInterceptor.java#L17

Added line #L17 was not covered by tests
private final TraceContext traceContext;
private final Boolean uriStatUseUserInput;

Expand Down Expand Up @@ -41,7 +42,11 @@
final ServletRequest request = ArrayArgumentUtils.getArgument(args, 0, ServletRequest.class);
if (request != null) {
final String uri = ServletRequestAttributeUtils.extractAttribute(request, SpringWebMvcConstants.SPRING_MVC_URI_USER_INPUT_ATTRIBUTE_KEYS);
logger.debug("Attempt recording URI with template: {}", uri);

if (isDebug) {
logger.debug("Attempt recording URI with template: {}", uri);

Check warning on line 47 in plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ProcessRequestInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/web/javax/interceptor/ProcessRequestInterceptor.java#L47

Added line #L47 was not covered by tests
}

if (StringUtils.hasLength(uri)) {
final SpanRecorder spanRecorder = trace.getSpanRecorder();
spanRecorder.recordUriTemplate(uri, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@
}
}
}
logger.debug("Raw Request URI: {}", request.getRequestURI());

if (isDebug) {
logger.debug("Raw Request URI: {}", request.getRequestURI());
}

Check warning on line 163 in plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/jakarta/interceptor/StandardHostValveInvokeInterceptor.java

View check run for this annotation

Codecov / codecov/patch

plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/jakarta/interceptor/StandardHostValveInvokeInterceptor.java#L162-L163

Added lines #L162 - L163 were not covered by tests
if (uriStatEnable && uriStatUseUserInput) {
recordUserUriTemplate(request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public void after(Object target, Object[] args, Object result, Throwable throwab
}
}
}
logger.debug("Raw Request URI: {}", request.getRequestURI());
if (isDebug) {
logger.debug("Raw Request URI: {}", request.getRequestURI());
}
if (uriStatEnable && uriStatUseUserInput) {
recordUserUriTemplate(request);
}
Expand Down