log method
Is called every time a new LogEvent is sent and handles printing or storing the message.
Implementation
@override
List<String> log(LogEvent event) {
var messageStr = stringifyMessage(event.message);
String? stackTraceStr;
if (event.stackTrace == null) {
if (methodCount > 0) {
stackTraceStr = formatStackTrace(StackTrace.current, methodCount);
}
} else if (errorMethodCount > 0) {
stackTraceStr = formatStackTrace(event.stackTrace, errorMethodCount);
}
var errorStr = event.error?.toString();
String? timeStr;
if (printTime) {
timeStr = getTime(event.time);
}
return _formatAndPrint(
event.level,
messageStr,
timeStr,
errorStr,
stackTraceStr,
);
}