LogRecord.fromJson constructor
What toJson made: the error as its text, the stack parsed from its text.
Implementation
factory LogRecord.fromJson(Map<String, Object?> json) => LogRecord(
DateTime.parse(json['time']! as String),
LogLevel.values.byName(json['level']! as String),
json['message']! as String,
error: json['error'] as String?,
stack: switch (json['stack']) {
final String stack => StackTrace.fromString(stack),
_ => null,
},
);