Skip to content

logging

Florian Schuster edited this page Apr 20, 2020 · 4 revisions

a configuration to define how a Controller logs its actions, mutations, state and errors. the configuration can be set for each Controller via the builder or via var ControllerLog.default to change it for all Controller's. the following are available:

  • None: logs nothing.
  • Println: Uses println to log.
  • Custom: allows to attach a custom logger.

The Custom logger allows to filter specific ControllerEvents:

val controller = scope.createController<Action, Mutation, State>(
    controllerLog = ControllerLog.Custom { message ->
        if (event is ControllerEvent.State) {
            println(message)
        }
    }
    ...,
)
Clone this wiki locally