DVLogShipper class
Buffers records on the device and posts them in batches.
post sends one body and answers the status; the generated runtime
passes a POST to <api>/_dartvel/client-logs. Nothing here logs through
the logger it is a sink of -- a failed send that logged would be a record
that has to be sent, which fails, which logs.
- Implemented types
Constructors
-
DVLogShipper({required Future<
int> post(String body), required String installId, required String release, required String platform, DVLogLevel level = DVLogLevel.warn, int batch = 50, int queue = 500, Duration interval = const Duration(seconds: 30)}) - DVLogShipper.toBackend({required Uri endpoint(), required String installId, required String release, required String platform, DVLogLevel level = DVLogLevel.warn, int batch = 50, Client? client, Duration timeout = const Duration(seconds: 15)})
-
Posts to the application's own backend at
endpoint, read at send time so the runtime's base URL is the one in force.factory
Properties
- batch → int
-
Records per request.
final
- dropped → int
-
Records that will never be sent: pushed out of a full queue, or in a
batch the backend refused for good.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- installId → String
-
final
- interval → Duration
-
How long a partial batch waits before it is sent anyway.
final
- level → DVLogLevel
-
The lowest level queued.
final
- pending → int
-
Records waiting to be sent.
no setter
- platform → String
-
final
- queue → int
-
Records held while the backend cannot be reached; past it the oldest
go, counted in dropped.
final
- release → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Stops the timer. Queued records stay queued.
-
flush(
) → Future< int> - Sends what is queued, a batch at a time, until a send does not succeed. Answers how many records were accepted.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
DVLogRecord record) → void -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited