onError method
Called when write fails or when a log-stream emits an error.
Does nothing by default: a failing sink should not take down the program it is logging for. Override this to report the failure somewhere else.
Implementation
void onError(Object error, StackTrace stackTrace) {}