Skip to content

Commit

Permalink
Update deprecated getMessageLogger(..) method usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rhusar authored and Ladicek committed Jan 15, 2025
1 parent ce0465d commit 582c432
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package io.smallrye.faulttolerance.core;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface CoreLogger extends BasicLogger {
CoreLogger LOG = Logger.getMessageLogger(CoreLogger.class, CoreLogger.class.getPackage().getName());
CoreLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), CoreLogger.class, CoreLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.smallrye.faulttolerance.core.async;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface AsyncLogger extends BasicLogger {
AsyncLogger LOG = Logger.getMessageLogger(AsyncLogger.class, AsyncLogger.class.getPackage().getName());
AsyncLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), AsyncLogger.class,
AsyncLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package io.smallrye.faulttolerance.core.bulkhead;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface BulkheadLogger extends BasicLogger {
BulkheadLogger LOG = Logger.getMessageLogger(BulkheadLogger.class, BulkheadLogger.class.getPackage().getName());
BulkheadLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), BulkheadLogger.class,
BulkheadLogger.class.getPackage().getName());

default void debugOrTrace(String debugMessage, String traceAmendment) {
if (isTraceEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package io.smallrye.faulttolerance.core.circuit.breaker;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface CircuitBreakerLogger extends BasicLogger {
CircuitBreakerLogger LOG = Logger.getMessageLogger(CircuitBreakerLogger.class,
CircuitBreakerLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), CircuitBreakerLogger.class,
CircuitBreakerLogger.class.getPackage().getName());

default void debugOrTrace(String debugMessage, String traceAmendment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static org.jboss.logging.annotations.Message.NONE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.LogMessage;
Expand All @@ -11,7 +13,8 @@

@MessageLogger(projectCode = "SRFTL", length = 5)
interface EventLoopLogger extends BasicLogger {
EventLoopLogger LOG = Logger.getMessageLogger(EventLoopLogger.class, EventLoopLogger.class.getPackage().getName());
EventLoopLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), EventLoopLogger.class,
EventLoopLogger.class.getPackage().getName());

@Message(id = NONE, value = "Found event loop integration %s")
@LogMessage(level = Logger.Level.DEBUG)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.smallrye.faulttolerance.core.fallback;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface FallbackLogger extends BasicLogger {
FallbackLogger LOG = Logger.getMessageLogger(FallbackLogger.class, FallbackLogger.class.getPackage().getName());
FallbackLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), FallbackLogger.class,
FallbackLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.smallrye.faulttolerance.core.metrics;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface MetricsLogger extends BasicLogger {
MetricsLogger LOG = Logger.getMessageLogger(MetricsLogger.class, MetricsLogger.class.getPackage().getName());
MetricsLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), MetricsLogger.class,
MetricsLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.smallrye.faulttolerance.core.rate.limit;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface RateLimitLogger extends BasicLogger {
RateLimitLogger LOG = Logger.getMessageLogger(RateLimitLogger.class,
RateLimitLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), RateLimitLogger.class,
RateLimitLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.smallrye.faulttolerance.core.retry;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface RetryLogger extends BasicLogger {
RetryLogger LOG = Logger.getMessageLogger(RetryLogger.class, RetryLogger.class.getPackage().getName());
RetryLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), RetryLogger.class,
RetryLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static org.jboss.logging.annotations.Message.NONE;

import java.lang.invoke.MethodHandles;

import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
Expand All @@ -12,7 +14,8 @@

@MessageLogger(projectCode = "SRFTL", length = 5)
interface TimeoutLogger extends BasicLogger {
TimeoutLogger LOG = Logger.getMessageLogger(TimeoutLogger.class, TimeoutLogger.class.getPackage().getName());
TimeoutLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), TimeoutLogger.class,
TimeoutLogger.class.getPackage().getName());

@Message(id = NONE, value = "AsyncTimeoutTask %s created")
@LogMessage(level = Logger.Level.TRACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static org.jboss.logging.annotations.Message.NONE;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
Expand All @@ -12,7 +14,8 @@

@MessageLogger(projectCode = "SRFTL", length = 5)
interface TimerLogger extends BasicLogger {
TimerLogger LOG = Logger.getMessageLogger(TimerLogger.class, TimerLogger.class.getPackage().getName());
TimerLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), TimerLogger.class,
TimerLogger.class.getPackage().getName());

@Message(id = NONE, value = "Timer %s created")
@LogMessage(level = Logger.Level.TRACE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.smallrye.faulttolerance;

import java.lang.invoke.MethodHandles;
import java.util.Set;

import jakarta.enterprise.inject.spi.DefinitionException;
Expand All @@ -14,7 +15,7 @@

@MessageLogger(projectCode = "SRFTL", length = 5)
interface CdiLogger extends BasicLogger {
CdiLogger LOG = Logger.getMessageLogger(CdiLogger.class, CdiLogger.class.getPackage().getName());
CdiLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), CdiLogger.class, CdiLogger.class.getPackage().getName());

@Message(id = 1, value = "MicroProfile: Fault Tolerance activated (SmallRye Fault Tolerance version: %s)")
@LogMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.smallrye.faulttolerance.internal;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface InternalLogger extends BasicLogger {
InternalLogger LOG = Logger.getMessageLogger(InternalLogger.class, InternalLogger.class.getPackage().getName());
InternalLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), InternalLogger.class,
InternalLogger.class.getPackage().getName());
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.smallrye.faulttolerance.vertx;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

@MessageLogger(projectCode = "SRFTL", length = 5)
interface VertxLogger extends BasicLogger {
VertxLogger LOG = Logger.getMessageLogger(VertxLogger.class, VertxLogger.class.getPackage().getName());
VertxLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), VertxLogger.class,
VertxLogger.class.getPackage().getName());
}

0 comments on commit 582c432

Please sign in to comment.