Function to create a String message of the state and exception.
String
state
exception
typedef LogFormatter<TState> = String Function( TState state, Object? error, );