Class TestingLog

  • All Implemented Interfaces:
    org.osgi.service.log.LogService

    public class TestingLog
    extends java.lang.Object
    implements org.osgi.service.log.LogService
    Provides a log service object to be used in testing. It can filter levels and messages and can trace stack traces and directly output the diagnostic info. At the end it can be checked if there were any messages logged that fell within the set criteria.
    • Field Summary

      • Fields inherited from interface org.osgi.service.log.LogService

        LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
    • Constructor Summary

      Constructors 
      Constructor Description
      TestingLog()  
    • Constructor Detail

      • TestingLog

        public TestingLog()
    • Method Detail

      • log

        public void log​(int level,
                        java.lang.String message)
        Specified by:
        log in interface org.osgi.service.log.LogService
      • log

        public void log​(int level,
                        java.lang.String message,
                        java.lang.Throwable exception)
        Specified by:
        log in interface org.osgi.service.log.LogService
      • log

        public void log​(org.osgi.framework.ServiceReference sr,
                        int level,
                        java.lang.String message)
        Specified by:
        log in interface org.osgi.service.log.LogService
      • log

        public void log​(org.osgi.framework.ServiceReference sr,
                        int level,
                        java.lang.String message,
                        java.lang.Throwable exception)
        Specified by:
        log in interface org.osgi.service.log.LogService
      • getEntries

        public java.util.List<org.osgi.service.log.LogEntry> getEntries()
      • filter

        public TestingLog filter​(java.lang.String pattern)
      • check

        public boolean check​(java.lang.String... patterns)