Package com.codeborne.selenide.logevents
Class SelenideLogger
java.lang.Object
com.codeborne.selenide.logevents.SelenideLogger
Logs Selenide test steps and notifies all registered LogEventListener about it
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addListener
(String name, LogEventListener listener) Add a listener (to the current thread).static SelenideLog
static SelenideLog
static void
commitStep
(SelenideLog log, LogEvent.EventStatus status) static void
commitStep
(SelenideLog log, Throwable error) static <T> T
static String
getReadableSubject
(String methodName, Object... args) static boolean
hasListener
(String name) If listener with given name is bound (added) to the current thread.static void
static <T extends LogEventListener>
TremoveListener
(String name) Remove listener (from the current thread).static void
static void
static <T> T
-
Constructor Details
-
SelenideLogger
public SelenideLogger()
-
-
Method Details
-
addListener
Add a listener (to the current thread).- Parameters:
name
- unique name of this listener (per thread). Can be used later to remove listener using methodremoveListener(String)
listener
- event listener
-
beginStep
@CheckReturnValue @Nonnull public static SelenideLog beginStep(String source, String methodName, @Nullable Object... args) -
getReadableSubject
-
beginStep
-
commitStep
-
commitStep
-
run
-
get
-
step
-
step
-
removeListener
Remove listener (from the current thread).- Type Parameters:
T
- class of listener to be returned- Parameters:
name
- unique name of listener added by methodaddListener(String, LogEventListener)
- Returns:
- the listener being removed
-
removeAllListeners
public static void removeAllListeners() -
hasListener
If listener with given name is bound (added) to the current thread.- Parameters:
name
- unique name of listener added by methodaddListener(String, LogEventListener)
- Returns:
- true if method
addListener(String, LogEventListener)
with corresponding name has been called in current thread.
-