LogsModel class

A data model that collects and stores logs from the rover.

The logs are kept in-memory in separate lists for subsystems, video, and autonomy, and are also saved to disk for retroactive debugging. To prevent slowing down the dashboard or consuming too much memory, the in-memory list is limited to maxLogCount, and logs are only saved to disk every saveToFileInterval.

Inheritance

Constructors

LogsModel()

Properties

allLogs → ListQueue<BurtLog>
The most recent maxLogCount logs received.
final
autonomyLogs → ListQueue<BurtLog>
The most recent maxLogCount received for Device.SUBSYSTEMS
final
dashboardLogs → ListQueue<BurtLog>
The most recent maxLogCount of messages from the dashboard
final
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
saveToFileBuffer ↔ List<BurtLog>
The logs received since the last flush to disk. See saveToFileInterval.
getter/setter pair
saveToFileTimer ↔ Timer?
A timer that checks for unsaved logs and flushes them to disk.
getter/setter pair
stream → Stream<BurtLog>
A stream of incoming logs.
no setter
subsystemLogs → ListQueue<BurtLog>
The most recent maxLogCount received for Device.SUBSYSTEMS
final
videoLogs → ListQueue<BurtLog>
The most recent maxLogCount received for Device.SUBSYSTEMS
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
Clears all the logs from memory (but not from disk).
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
handleLog(BurtLog log) → void
Sends a log message to be shown in the footer.
init() → Future<void>
Initializes any data needed by this model.
override
logsForDevice(Device? device) → ListQueue<BurtLog>?
Returns the list of log messages for the corresponding device
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
saveToFile(dynamic _) → Future<void>
Saves all the logs in saveToFileBuffer to disk.
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

saveToFileInterval → const Duration
How often to save the buffered logs to the log file.