LogRecord.fromJson constructor

LogRecord.fromJson(
  1. Map<String, Object?> json
)

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,
  },
);