Package aQute.bnd.testing
Class TestingLog
- java.lang.Object
-
- aQute.bnd.testing.TestingLog
-
- All Implemented Interfaces:
org.osgi.service.log.LogService
public class TestingLog extends java.lang.Object implements org.osgi.service.log.LogServiceProvides 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.
-
-
Constructor Summary
Constructors Constructor Description TestingLog()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheck(java.lang.String... patterns)TestingLogdebugs()TestingLogdirect()TestingLogerrors()TestingLogfilter(java.lang.String pattern)TestingLogfull()java.util.List<org.osgi.service.log.LogEntry>getEntries()TestingLoginfos()TestingLoglevel(int level)voidlog(int level, java.lang.String message)voidlog(int level, java.lang.String message, java.lang.Throwable exception)voidlog(org.osgi.framework.ServiceReference sr, int level, java.lang.String message)voidlog(org.osgi.framework.ServiceReference sr, int level, java.lang.String message, java.lang.Throwable exception)TestingLogstacktrace()TestingLogwarnings()
-
-
-
Method Detail
-
log
public void log(int level, java.lang.String message)- Specified by:
login interfaceorg.osgi.service.log.LogService
-
log
public void log(int level, java.lang.String message, java.lang.Throwable exception)- Specified by:
login interfaceorg.osgi.service.log.LogService
-
log
public void log(org.osgi.framework.ServiceReference sr, int level, java.lang.String message)- Specified by:
login interfaceorg.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:
login interfaceorg.osgi.service.log.LogService
-
getEntries
public java.util.List<org.osgi.service.log.LogEntry> getEntries()
-
filter
public TestingLog filter(java.lang.String pattern)
-
stacktrace
public TestingLog stacktrace()
-
direct
public TestingLog direct()
-
errors
public TestingLog errors()
-
warnings
public TestingLog warnings()
-
infos
public TestingLog infos()
-
debugs
public TestingLog debugs()
-
level
public TestingLog level(int level)
-
full
public TestingLog full()
-
check
public boolean check(java.lang.String... patterns)
-
-