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) {
final logColor = PrettyPrinter.levelColors[event.level];
final emoji = PrettyPrinter.levelEmojis[event.level];
final message = event.message;
const splitter = LineSplitter();
final splitMessage = splitter.convert('$message');
splitMessage[0] = '${'${DateTime.now()} '} $emoji $className-($counter) '
'- ${splitMessage[0]}';
if (colorsEnabled) {
return splitMessage.map((line) => logColor!(line)).toList();
}
return splitMessage;
}