action method
Prints the log event to console.
Only prints in debug mode. Uses formatted data from PVStdFormatter if available, otherwise formats the raw message directly.
Implementation
@override
void action(PVLogEvent event) {
if (!kDebugMode) {
return;
}
// Use formatted data if available, otherwise fallback to raw
if (event.extra.containsKey('pvlogger_formatted')) {
final formattedData = event.extra['pvlogger_formatted']!;
final formatted = formattedData['formatted'] as List<String>;
for (final line in formatted) {
print(line);
}
} else {
print(jsonify(event.raw));
}
}