SyncLogDebug.fromJson constructor

SyncLogDebug.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SyncLogDebug.fromJson(Map<String, dynamic> json) {
  return SyncLogDebug(
    id: json['id'],
    timestamp: DateTime.parse(json['timestamp']),
    level: SyncLogDebugLevel.values.firstWhere(
      (e) => e.name == json['level'],
      orElse: () => SyncLogDebugLevel.info,
    ),
    message: json['message'],
    category: json['category'],
    tag: json['tag'],
    metadata: json['metadata'],
    stackTrace: json['stackTrace'],
    userId: json['userId'],
    sessionId: json['sessionId'],
  );
}