FirebaseTransport class

Combined Firebase transport that sends every log event to Analytics and additionally forwards errors to Crashlytics.

Routing rules:

  • All levelsFirebaseAnalytics.instance.logEvent
  • LogLevel.error / LogLevel.fatal, or any event where LogEvent.error is non-null → also sent to Crashlytics:
    • If LogEvent.error is present → FirebaseCrashlytics.instance.recordError (fatal: true only for LogLevel.fatal).
    • If LogEvent.error is absent → FirebaseCrashlytics.instance.log.

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 AnalyticsCallOptions forwarded 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 event to the transport's destination.
log(LogEvent event) Future<void>
Delivers event to the destination if event.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