copyWith method

LogEntry copyWith({
  1. int? id,
  2. String? instanceId,
  3. String? serviceName,
  4. LogLevel? level,
  5. DateTime? timestamp,
  6. String? message,
  7. String? sender,
  8. bool nullSender = false,
  9. Map<String, String>? path,
  10. bool nullPath = false,
  11. Map<String, dynamic>? meta,
  12. bool nullMeta = false,
})

Implementation

LogEntry copyWith({
  int? id,
  String? instanceId,
  String? serviceName,
  LogLevel? level,
  DateTime? timestamp,
  String? message,
  String? sender,
  bool nullSender = false,
  Map<String, String>? path,
  bool nullPath = false,
  Map<String, dynamic>? meta,
  bool nullMeta = false,
}) {
  return LogEntry(
    id: id ?? this.id,
    instanceId: instanceId ?? this.instanceId,
    serviceName: serviceName ?? this.serviceName,
    level: level ?? this.level,
    timestamp: timestamp ?? this.timestamp,
    message: message ?? this.message,
    sender: nullSender ? null : (sender ?? this.sender),
    path: nullPath ? null : (path ?? this.path),
    meta: nullMeta ? null : (meta ?? this.meta),
  );
}