Package com.exasol.logging
Class CapturingLogHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- com.exasol.logging.CapturingLogHandler
-
public class CapturingLogHandler extends Handler
This class implements a dummy log handler that allows capturing the log messages.This allows checking the contents of the log messages in unit tests.
-
-
Constructor Summary
Constructors Constructor Description CapturingLogHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()StringgetCapturedData()Get the captured data from the messagesvoidpublish(LogRecord record)voidreset()Reset the capture buffer-
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
-
-
-
Method Detail
-
getCapturedData
public String getCapturedData()
Get the captured data from the messages- Returns:
- messages as string
-
reset
public void reset()
Reset the capture buffer
-
-