Package org.apache.activemq.artemis.logs
Class AssertionLoggerHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- org.jboss.logmanager.ExtHandler
-
- org.apache.activemq.artemis.logs.AssertionLoggerHandler
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,org.jboss.logmanager.handlers.FlushableCloseable,org.jboss.logmanager.Protectable
public class AssertionLoggerHandler extends org.jboss.logmanager.ExtHandlerThis class contains a tool where programs could intercept for LogMessage given an interval of time betweenstartCapture()andstopCapture()Be careful with this use as this is intended for testing only (such as testcases)
-
-
Constructor Summary
Constructors Constructor Description AssertionLoggerHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclear()voidclose()static intcountText(java.lang.String... text)protected voiddoPublish(org.jboss.logmanager.ExtLogRecord record)static booleanfindText(long mstimeout, java.lang.String... text)static booleanfindText(java.lang.String... text)Find a line that contains the parameters passed as an argumentvoidflush()static booleanhasLevel(java.util.logging.Level level)is there any record matching Level?static booleanmatchText(java.lang.String pattern)static voidstartCapture()static voidstartCapture(boolean individualMessages)static voidstopCapture()-
Methods inherited from class org.jboss.logmanager.ExtHandler
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setEncoding, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
-
-
-
-
Method Detail
-
flush
public void flush()
- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classorg.jboss.logmanager.ExtHandler
-
close
public void close() throws java.lang.SecurityException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classorg.jboss.logmanager.ExtHandler- Throws:
java.lang.SecurityException
-
doPublish
protected void doPublish(org.jboss.logmanager.ExtLogRecord record)
- Overrides:
doPublishin classorg.jboss.logmanager.ExtHandler
-
hasLevel
public static boolean hasLevel(java.util.logging.Level level)
is there any record matching Level?- Parameters:
level-- Returns:
-
findText
public static boolean findText(long mstimeout, java.lang.String... text)
-
findText
public static boolean findText(java.lang.String... text)
Find a line that contains the parameters passed as an argument- Parameters:
text-- Returns:
-
countText
public static int countText(java.lang.String... text)
-
matchText
public static boolean matchText(java.lang.String pattern)
-
clear
public static final void clear()
-
startCapture
public static final void startCapture()
-
startCapture
public static final void startCapture(boolean individualMessages)
- Parameters:
individualMessages- enables counting individual messages.
-
stopCapture
public static final void stopCapture()
-
-