NeomErrorLogger class

Centralized error logger that sends errors to Firebase Crashlytics and stores aggregated error counts in Firestore for the error monitor.

Usage:

} catch (e, st) {
  NeomErrorLogger.recordError(e, st, module: 'neom_shop', operation: 'retrieveProducts');
}

Constructors

NeomErrorLogger()

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

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

Static Methods

flushAll() Future<void>
Force-flushes all pending errors (call on app lifecycle events).
recordError(Object error, StackTrace? stackTrace, {required String module, required String operation, bool fatal = false, bool skipDebug = true}) Future<void>
Records an error to Crashlytics and Firestore.
recordErrorLight(Object error, StackTrace? stackTrace, {required String module, required String operation}) → void
Lightweight version that only logs to Crashlytics without Firestore. Use for high-frequency errors where Firestore writes would be too expensive.
resetAllCounts() Future<void>
Resets all error counts in Firestore (admin action).