Skip to content

Commit

Permalink
Use module-friendly logger methods (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd authored Nov 26, 2024
1 parent a13acb4 commit 029c88e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.smallrye.config._private;

import java.lang.invoke.MethodHandles;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
Expand All @@ -9,7 +11,7 @@

@MessageLogger(projectCode = "SRCFG", length = 5)
public interface ConfigLogging extends BasicLogger {
ConfigLogging log = Logger.getMessageLogger(ConfigLogging.class, "io.smallrye.config");
ConfigLogging log = Logger.getMessageLogger(MethodHandles.lookup(), ConfigLogging.class, "io.smallrye.config");

@LogMessage(level = Logger.Level.WARN)
@Message(id = 1000, value = "Unable to get context classloader instance")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.smallrye.config.source.file;

import java.lang.invoke.MethodHandles;

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

@MessageLogger(projectCode = "SRCFG", length = 5)
interface FileSystemLogging extends BasicLogger {
FileSystemLogging log = Logger.getMessageLogger(FileSystemLogging.class, FileSystemLogging.class.getPackage().getName());
FileSystemLogging log = Logger.getMessageLogger(MethodHandles.lookup(), FileSystemLogging.class,
FileSystemLogging.class.getPackage().getName());

@LogMessage(level = Logger.Level.WARN)
@Message(id = 3000, value = "Unable to read content from file %s. Exception: %s")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.smallrye.config.source.zookeeper;

import java.lang.invoke.MethodHandles;

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

@MessageLogger(projectCode = "SRCFG", length = 5)
interface ZooKeepperLogging extends BasicLogger {
ZooKeepperLogging log = Logger.getMessageLogger(ZooKeepperLogging.class, ZooKeepperLogging.class.getPackage().getName());
ZooKeepperLogging log = Logger.getMessageLogger(MethodHandles.lookup(), ZooKeepperLogging.class,
ZooKeepperLogging.class.getPackage().getName());

@LogMessage(level = Logger.Level.WARN)
@Message(id = 4500, value = "Failed to retrieve property names from ZooKeeperConfigSource")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.smallrye.config.events.regex;

import java.lang.invoke.MethodHandles;

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

@MessageLogger(projectCode = "SRCFG", length = 5)
interface RegexLogging extends BasicLogger {
RegexLogging log = Logger.getMessageLogger(RegexLogging.class, RegexLogging.class.getPackage().getName());
RegexLogging log = Logger.getMessageLogger(MethodHandles.lookup(), RegexLogging.class,
RegexLogging.class.getPackage().getName());

@LogMessage(level = Logger.Level.WARN)
@Message(id = 5000, value = "Can not find ChangeEvent parameter for method %s. @RegexFilter is being ignored")
Expand Down

0 comments on commit 029c88e

Please sign in to comment.