Class NoOpLogger

    • Constructor Summary

      Constructors 
      Constructor Description
      NoOpLogger()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BundleLogger bundle​(org.osgi.framework.Bundle bundle)
      Create a bundle logger
      void close()
      Close the log manager
      ComponentLogger component​(org.osgi.framework.Bundle bundle, java.lang.String implementationClassName, java.lang.String name)  
      boolean isLogEnabled​(InternalLogger.Level level)
      Answer true if the current logging level is enabled for the given level.
      void log​(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex)
      Logs the message to an appropriate OSGi logger.
      void log​(InternalLogger.Level level, java.lang.String message, java.lang.Throwable ex, java.lang.Object... args)
      Formats the message using the MessageFormat class, i.e.
      void setComponentId​(long componentId)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NoOpLogger

        public NoOpLogger()
    • Method Detail

      • log

        public void log​(InternalLogger.Level level,
                        java.lang.String message,
                        java.lang.Throwable ex)
        Description copied from interface: InternalLogger
        Logs the message to an appropriate OSGi logger. If not such logger can be found then it will log to stderr for ERROR & AUDIT messages and stdout for other messages
        Specified by:
        log in interface InternalLogger
        Parameters:
        level - only log when this level is implied by the current log level
        message - the message to log
        ex - a Throwable or null
      • log

        public void log​(InternalLogger.Level level,
                        java.lang.String message,
                        java.lang.Throwable ex,
                        java.lang.Object... args)
        Description copied from interface: InternalLogger
        Formats the message using the MessageFormat class, i.e. with {} place holders for the args. It then calls InternalLogger.log(Level, String, Throwable).
        Specified by:
        log in interface InternalLogger
        Parameters:
        level - only log when this level is implied by the current log level
        message - the message to log
        ex - a Throwable or null
        args - the arguments to the MessageFormat formatting
      • isLogEnabled

        public boolean isLogEnabled​(InternalLogger.Level level)
        Description copied from interface: InternalLogger
        Answer true if the current logging level is enabled for the given level. For stdout/stderr fallback the logging level is defined by the LogConfiguration.getLogLevel(). If there is an OSGi logger available then the logger name will define the log level via LoggerAdmin.
        Specified by:
        isLogEnabled in interface InternalLogger
        Parameters:
        level - the level to check
        Returns:
        true if the given log level is enabled
      • component

        public ComponentLogger component​(org.osgi.framework.Bundle bundle,
                                         java.lang.String implementationClassName,
                                         java.lang.String name)
        Specified by:
        component in interface BundleLogger
      • bundle

        public BundleLogger bundle​(org.osgi.framework.Bundle bundle)
        Description copied from interface: ScrLogger
        Create a bundle logger
        Specified by:
        bundle in interface ScrLogger
      • close

        public void close()
        Description copied from interface: ScrLogger
        Close the log manager
        Specified by:
        close in interface ScrLogger