MokkeryCallLogger
class MokkeryCallLogger(lineTransformer: (String) -> String = { it }, loggingFunction: (String) -> Unit = ::println) : MokkeryCallListener(source)
Logs each mock call with loggingFunction. By default, the loggingFunction is println.
Log line can be changed using lineTransformer.
To enable the logger, it has to be registered in a hook.
Example:
// Globally
MokkeryScope
.global
.callHooks
.beforeAnswering
.register(MokkeryCallLogger())
// Per mock
MokkeryScope
.from(mock)
.callHooks
.beforeAnswering
.register(MokkeryCallLogger())Content copied to clipboard
See also
Functions
Link copied to clipboard
Do not override this method to keep MokkeryCallListener behaviour as intended.
Link copied to clipboard