Class NoopLogger

  • All Implemented Interfaces:
    Logger

    public class NoopLogger
    extends Object
    implements Logger
    A no-op Logger implementation (for the most part). The one exception is the Logger.replace(Logger) operation that actually returns the supplied value.
    Since:
    2
    • Constructor Detail

      • NoopLogger

        public NoopLogger()
        The sole public constructor.
    • Method Detail

      • getInstance

        public static NoopLogger getInstance()
        Returns the static instance. This is method is provided as a convenience and to avoid creating multiple instances of this instance.
        Returns:
        the static instance
      • isEnabled

        public boolean isEnabled​(Event event)
        Returns false.
        Specified by:
        isEnabled in interface Logger
        Parameters:
        event - an event instance (ignored)
        Returns:
        false
      • log

        public void log​(Event0 event)
        Does nothing, this is a no-op logger.
        Specified by:
        log in interface Logger
        Parameters:
        event - an event instance (ignored)
      • log

        public <T1> void log​(Event1<T1> event,
                             T1 v1)
        Does nothing, this is a no-op logger.
        Specified by:
        log in interface Logger
        Type Parameters:
        T1 - type of the log argument
        Parameters:
        event - an event instance (ignored)
        v1 - a value (ignored)
      • log

        public <T1,​T2> void log​(Event2<T1,​T2> event,
                                      T1 v1,
                                      T2 v2)
        Does nothing, this is a no-op logger.
        Specified by:
        log in interface Logger
        Type Parameters:
        T1 - type of the first log argument
        T2 - type of the second log argument
        Parameters:
        event - an event instance (ignored)
        v1 - a first value (ignored)
        v2 - a second value (ignored)
      • log

        public <T1,​T2,​T3> void log​(Event3<T1,​T2,​T3> event,
                                               T1 v1,
                                               T2 v2,
                                               T3 v3)
        Does nothing, this is a no-op logger.
        Specified by:
        log in interface Logger
        Type Parameters:
        T1 - type of the first log argument
        T2 - type of the second log argument
        T3 - type of the third log argument
        Parameters:
        event - an event instance (ignored)
        v1 - a first value (ignored)
        v2 - a second value (ignored)
        v3 - a third value (ignored)
      • replace

        public final Logger replace​(Logger logger)
        Returns the given logger value.
        Specified by:
        replace in interface Logger
        Parameters:
        logger - a Logger instance
        Returns:
        the given logger value