FirebaseTransport class
Combined Firebase transport that sends every log event to Analytics and additionally forwards errors to Crashlytics.
Routing rules:
- All levels →
FirebaseAnalytics.instance.logEvent LogLevel.error/LogLevel.fatal, or any event whereLogEvent.erroris non-null → also sent to Crashlytics:- If
LogEvent.erroris present →FirebaseCrashlytics.instance.recordError(fatal: trueonly forLogLevel.fatal). - If
LogEvent.erroris absent →FirebaseCrashlytics.instance.log.
- If
config keys (all optional):
| key | type | description |
|---|---|---|
name |
String | Analytics event name template ({context}, {level}). Default 'revere'. |
format |
String | Message body template. Default '[{level}:{context}] {message}'. |
callOptions |
AnalyticsCallOptions | Forwarded to Analytics. |
Constructors
-
FirebaseTransport({LogLevel level = LogLevel.info, Map<
String, dynamic> config = const {}}) - Creates a FirebaseTransport.
Properties
- callOptions → AnalyticsCallOptions?
-
Optional
AnalyticsCallOptionsforwarded to Firebase Analytics.final -
config
→ Map<
String, dynamic> -
Arbitrary key/value options passed to the transport at construction time.
finalinherited
- format → String
-
Log message body template. Supports
{level},{message},{timestamp},{context},{error},{stackTrace}placeholders.final - hashCode → int
-
The hash code for this object.
no setterinherited
- level → LogLevel
-
Minimum severity level this transport will handle.
finalinherited
- name → String
-
Analytics event name template. Supports
{context}and{level}. Defaults to'revere'.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispatchAnalyticsEvent(
String name, Map< String, Object> ? parameters, AnalyticsCallOptions? callOptions) → Future<void> -
dispatchCrashlyticsError(
Object error, StackTrace? stackTrace, {bool fatal = false, String? reason}) → Future< void> -
dispatchCrashlyticsLog(
String message) → Future< void> -
emitLog(
LogEvent event) → Future< void> -
Performs the actual delivery of
eventto the transport's destination. -
log(
LogEvent event) → Future< void> -
Delivers
eventto the destination ifevent.level >= this.level.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited