29 lines
513 B
Dart
29 lines
513 B
Dart
import 'package:isar/isar.dart';
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'log_entry.g.dart';
|
|
|
|
enum LogEntrySeverityEnum {
|
|
info,
|
|
debug,
|
|
error
|
|
}
|
|
|
|
@collection
|
|
@JsonSerializable()
|
|
class LogEntry {
|
|
late Id id = Isar.autoIncrement;
|
|
|
|
late DateTime time;
|
|
|
|
@enumerated
|
|
late LogEntrySeverityEnum severity;
|
|
|
|
late String text;
|
|
|
|
LogEntry();
|
|
|
|
factory LogEntry.fromJson(Map<String, dynamic> json) => _$LogEntryFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$LogEntryToJson(this);
|
|
} |