toJson method

Map<String, Object?> toJson()

Message for logging to Map<String, Object?> date is converted to int date microseconds since epoch message is converted to String message level is converted to String level prefix (e.g. e) stackTrace is converted to String stack_trace

Implementation

Map<String, Object?> toJson() => <String, Object>{
      'date': date.microsecondsSinceEpoch,
      'message': message.toString(),
      'level': level.prefix,
      if (this case LogMessageWithStackTrace(:final StackTrace stackTrace))
        'stack_trace': stackTrace.toString(),
    };