LogStorageService class
Service for storing logs to persistent storage.
This service uses an isolate to write logs to the application support directory. The logs are written in JSON Lines format.
The logs are written to two files, simple_logs.jsonl and network_logs.jsonl.
The first file contains logs from the LoggerController.log method, while
the second file contains logs from the NetworkLoggerInterceptor.
Constructors
- LogStorageService.new()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addNetworkLog(
NetworkLog log) → Future< void> - Writes a NetworkLog to the persistent log file.
-
addSimpleLog(
SimpleLog log) → Future< void> - Writes a SimpleLog to the persistent log file.
-
getNetworkLogs(
) → Future< List< NetworkLog> > - Reads all network logs from persistent storage.
-
getSimpleLogs(
) → Future< List< SimpleLog> > - Reads all simple logs from persistent storage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
purgeOldLogs(
) → Future< void> - Deletes all logs older than 2 days from persistent storage.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- enableConsole ↔ bool
-
Enables styled logging to console. Defaults to true.
getter/setter pair