LazyLumberdash class abstract
LazyLumberdash is an abstraction of LumberdashClient that registers
log calls on an array, using registerLogCall
to be later drained when
calling dispatchLogCalls
.
The registerLogCall
notifies the implementer using onNewLogCall
method. Implementers need to override this method so they can decide
when to dispatch the log calls using the dispatchLogCalls
method.
LazyLumberdash also provides the method close
which forces the
dispatch of all log calls. This is useful for example when exiting the app
and not all log calls have been sent to a server or a file.
If the implementer decides to override the close
, dispatchLogCalls
and
registerLogCall
methods, it needs to call the super implementation in the
first place.
- Inheritance
-
- Object
- LumberdashClient
- LazyLumberdash
- Implementers
Constructors
- LazyLumberdash({required LumberdashClient client})
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
-
close(
) → void -
Calls
dispatchLogCalls
-
dispatchLogCalls(
) → void -
Dispatches all log calls that exist on
_logCalls
array in a FIFO order. Uses_lock
to grant mutual exclusion access on the log calls dispatch. -
logError(
dynamic exception, [dynamic stacktrace]) → void -
Registers a
_innerLumberdashClient
logError
call on_logCalls
override -
logFatal(
String message, [Map< String, String> ? extras]) → void -
Registers a
_innerLumberdashClient
logFatal
call on_logCalls
override -
logMessage(
String message, [Map< String, String> ? extras]) → void -
Registers a
_innerLumberdashClient
logMessage
call on_logCalls
override -
logWarning(
String message, [Map< String, String> ? extras]) → void -
Registers a
_innerLumberdashClient
logWarning
call on_logCalls
override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onNewLogCall(
void call()) → void -
Override this method to listen to new log calls and
decide whether or not you should call
dispatchLogCalls
. -
registerLogCall(
void call()) → void -
Endpoint for
_innerLumberdashClient
log calls registry on_logCalls
. Notifies the implementer after register the call, by callonNewLogCall
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited