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

Apply ConsistentLoggerName #993

Merged
merged 1 commit into from
Feb 13, 2021
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 @@ -38,7 +38,7 @@

abstract class InvocationEventProxy implements InvocationHandler {

private static final Logger logger = LoggerFactory.getLogger(InvocationEventProxy.class);
private static final Logger log = LoggerFactory.getLogger(InvocationEventProxy.class);
private static final Object[] EMPTY_ARRAY = new Object[0];

private final InstrumentationFilter filter;
Expand Down Expand Up @@ -194,8 +194,8 @@ private static SafeArg<String> safeSimpleClassName(@CompileTimeConstant String n

static void logInvocationWarning(
String event, @Nullable InvocationContext context, @Nullable Object result, Throwable cause) {
if (logger.isWarnEnabled()) {
logger.warn(
if (log.isWarnEnabled()) {
log.warn(
"{} occurred handling '{}' ({}, {}): {}",
safeSimpleClassName("cause", cause),
SafeArg.of("event", event),
Expand All @@ -206,8 +206,8 @@ static void logInvocationWarning(
}

static void logInvocationWarning(String event, Object instance, Method method, Throwable cause) {
if (logger.isWarnEnabled()) {
logger.warn(
if (log.isWarnEnabled()) {
log.warn(
"{} occurred handling '{}' invocation of {} {} on {} instance: {}",
safeSimpleClassName("cause", cause),
SafeArg.of("event", event),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
/** Utilities for working with {@link MetricRegistry} instances. */
public final class MetricRegistries {

private static final Logger logger = LoggerFactory.getLogger(MetricRegistries.class);
private static final Logger log = LoggerFactory.getLogger(MetricRegistries.class);

static final String RESERVOIR_TYPE_METRIC_NAME = MetricRegistry.name(MetricRegistries.class, "reservoir.type");

Expand Down Expand Up @@ -461,15 +461,15 @@ private static <T extends Metric> T registerOrReplace(
}

if (replace && registry.remove(name)) {
logger.info(
log.info(
"Removed existing registered metric with name {}: {}",
SafeArg.of("name", name),
// #256: Metric implementations are necessarily json serializable
SafeArg.of("existingMetric", String.valueOf(existingMetric)));
registry.register(name, metric);
return metric;
} else {
logger.warn(
log.warn(
"Metric already registered at this name. Name: {}, existing metric: {}",
SafeArg.of("name", name),
// #256: Metric implementations are necessarily json serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
public final class RemotingCompatibleTracingInvocationEventHandler
extends AbstractInvocationEventHandler<InvocationContext> {

private static final Logger logger = LoggerFactory.getLogger(RemotingCompatibleTracingInvocationEventHandler.class);
private static final Logger log = LoggerFactory.getLogger(RemotingCompatibleTracingInvocationEventHandler.class);

private static final AtomicBoolean shouldLogFallbackError = new AtomicBoolean();

Expand Down Expand Up @@ -76,7 +76,7 @@ public final class RemotingCompatibleTracingInvocationEventHandler
}
} catch (ReflectiveOperationException e) {
// expected case when remoting3 is not on classpath
logger.debug("Remoting3 unavailable, using Java tracing", e);
log.debug("Remoting3 unavailable, using Java tracing", e);
}

return JavaTracingTracer.INSTANCE;
Expand Down Expand Up @@ -157,7 +157,7 @@ private static boolean isUsingMultipleTracers(Class<?> tracersClass)
wrappedTrace.getClass().getPackage().getName();
if (!Objects.equals(expectedTracingPackage, actualTracingPackage)) {
if (shouldLogFallbackError.compareAndSet(false, true)) {
logger.error(
log.error(
"Multiple tracing implementations detected, expected '{}' but found '{}',"
+ " using legacy remoting3 tracing for backward compatibility",
SafeArg.of("expectedPackage", expectedTracingPackage),
Expand Down