Package elf4j.engine

Class NativeLogger

  • All Implemented Interfaces:
    elf4j.Logger

    @ThreadSafe
    public class NativeLogger
    extends Object
    implements elf4j.Logger
    Any instance of this class is thread-safe; it can be safely used as static, instance, or local variables. However, instances returned by the static factory method Logger.instance() are more expensive to create; it is recommended to use them as static variables. Other instances are less expensive; they are fit to be used as any kind of variables.
    • Constructor Detail

      • NativeLogger

        public NativeLogger​(@NonNull
                            @NonNull String ownerClassName,
                            @NonNull
                            @NonNull elf4j.Level level,
                            @NonNull
                            @NonNull NativeLoggerFactory nativeLoggerFactory)
        Constructor only meant to be used by NativeLoggerFactory and this class itself
        Parameters:
        ownerClassName - name of the owner class that requested this instance via the Logger.instance() method
        level - severity level of this logger instance
        nativeLoggerFactory - log service access point from this instance, not reloadable
    • Method Detail

      • atLevel

        public NativeLogger atLevel​(elf4j.Level level)
        Specified by:
        atLevel in interface elf4j.Logger
      • getLevel

        @NonNull
        public @NonNull elf4j.Level getLevel()
        Specified by:
        getLevel in interface elf4j.Logger
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface elf4j.Logger
      • log

        public void log​(Object message)
        Specified by:
        log in interface elf4j.Logger
      • log

        public void log​(String message,
                        Object... arguments)
        Specified by:
        log in interface elf4j.Logger
      • log

        public void log​(Throwable throwable)
        Specified by:
        log in interface elf4j.Logger
      • log

        public void log​(Throwable throwable,
                        Object message)
        Specified by:
        log in interface elf4j.Logger
      • log

        public void log​(Throwable throwable,
                        String message,
                        Object... arguments)
        Specified by:
        log in interface elf4j.Logger
      • getLogService

        public LogService getLogService()
        Returns:
        directly callable log service, useful for log APIs than elf4j to use this engine
      • getOwnerClassName

        @NonNull
        public @NonNull String getOwnerClassName()
        Returns:
        owner/caller class of this logger instance