- * In rare and not-recommended scenarios, the owner class can be different from the caller class: e.g. the owner - * class could pass a reference of this logger instance out to a different/caller class. Once set, though, the value - * of this field will never change even when the owner class is different from the caller class. + * In rare and not-recommended scenarios, the declaring class can be different from the caller class: e.g. the + * declaring class could pass a reference of this logger instance out to a different/caller class. Once set, though, + * the value of this field will never change even when the declaring class is different from the caller class. *
* To reduce the frequency of having to walk the call stack in order to locate the caller class, this native ELF4J
- * implementation assumes the owner and caller class to be one and the same. Thus, for logging output that requires
- * only the caller class name, this field will be used in liu of checking the stack trace; i.e. the stack trace
- * walking is needed only when more caller details (e.g. method name, file name, line number) are required.
+ * implementation assumes the declaring and caller class to be one and the same. Thus, for logging output that
+ * requires only the caller class name, this field will be used in liu of checking the stack trace; i.e. the stack
+ * trace walking is needed only when more caller details (e.g. method name, file name, line number) are required.
*/
- private final @NonNull String ownerClassName;
+ private final @NonNull String declaringClassName;
private final @NonNull Level level;
private final @NonNull NativeLoggerFactory nativeLoggerFactory;
@@ -61,21 +61,23 @@ public class NativeLogger implements Logger {
/**
* Constructor only meant to be used by {@link NativeLoggerFactory} and this class itself
*
- * @param ownerClassName name of the owner class that requested this instance via the {@link Logger#instance()}
- * method
- * @param level severity level of this logger instance
+ * @param declaringClassName name of the declaring class that requested this instance via the
+ * {@link Logger#instance()} method
+ * @param level severity level of this logger instance
* @param nativeLoggerFactory log service access point from this instance, not reloadable
*/
public NativeLogger(
- @NonNull String ownerClassName, @NonNull Level level, @NonNull NativeLoggerFactory nativeLoggerFactory) {
- this.ownerClassName = ownerClassName;
+ @NonNull String declaringClassName,
+ @NonNull Level level,
+ @NonNull NativeLoggerFactory nativeLoggerFactory) {
+ this.declaringClassName = declaringClassName;
this.level = level;
this.nativeLoggerFactory = nativeLoggerFactory;
}
@Override
public NativeLogger atLevel(Level level) {
- return this.level == level ? this : this.nativeLoggerFactory.getLogger(level, this.ownerClassName);
+ return this.level == level ? this : this.nativeLoggerFactory.getLogger(level, this.declaringClassName);
}
@Override
@@ -121,10 +123,10 @@ public LogService getLogService() {
}
/**
- * @return owner/caller class of this logger instance
+ * @return declaring/caller class of this logger instance
*/
- public @NonNull String getOwnerClassName() {
- return this.ownerClassName;
+ public @NonNull String getDeclaringClassName() {
+ return this.declaringClassName;
}
private void service(Throwable throwable, Object message, Object[] arguments) {
diff --git a/src/main/java/elf4j/engine/service/LogEvent.java b/src/main/java/elf4j/engine/service/LogEvent.java
index f981550..5906fa6 100644
--- a/src/main/java/elf4j/engine/service/LogEvent.java
+++ b/src/main/java/elf4j/engine/service/LogEvent.java
@@ -98,7 +98,7 @@ public class LogEvent {
* @return the name of the application client class calling the logging method of this logger instance
*/
public String getCallerClassName() {
- return callerFrame != null ? callerFrame.getClassName() : nativeLogger.getOwnerClassName();
+ return callerFrame != null ? callerFrame.getClassName() : nativeLogger.getDeclaringClassName();
}
/**
diff --git a/src/main/java/elf4j/engine/service/configuration/OverridingCallerLevels.java b/src/main/java/elf4j/engine/service/configuration/OverridingCallerLevels.java
index 461de8d..caaf33b 100644
--- a/src/main/java/elf4j/engine/service/configuration/OverridingCallerLevels.java
+++ b/src/main/java/elf4j/engine/service/configuration/OverridingCallerLevels.java
@@ -83,7 +83,7 @@ private static Optional