SimpleOverlayBaseLog class abstract

Abstract base class for all log entries in the logging system.

This class defines the common structure and behavior for all log entries. All specific log types (e.g., SimpleLog, NetworkLog) should extend this class.

Properties:

  • timestamp: When the log entry was created
  • tag: A string identifier for categorizing or filtering logs

Implementations must override toJson() to provide serialization logic.

Example:

class CustomLog extends BaseLog {
  final String message;

  CustomLog({
    required DateTime timestamp,
    required String tag,
    required this.message,
  }) : super(timestamp: timestamp, tag: tag);

  @override
  Map<String, dynamic> toJson() => {
    'timestamp': timestamp.toIso8601String(),
    'tag': tag,
    'message': message,
    'type': 'custom',
  };
}
Implementers

Constructors

SimpleOverlayBaseLog.new({required DateTime timestamp, required String tag})
Creates a new SimpleOverlayBaseLog instance.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag String
A string identifier used to categorize or filter logs.
final
timestamp DateTime
The exact date and time when the log entry was created.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the log entry to a JSON-serializable map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited