SentryAppLogger class
Production AppLogger implementation that routes log output to Sentry.
Each severity level is handled as follows:
- debug — prints to the console in debug mode only; not sent to Sentry.
- info — adds a Sentry breadcrumb (
app.info) and prints in debug mode. - warn — adds a Sentry breadcrumb (
app.warn), prints in debug mode, and — whenescalateistrue— captures the event or exception in Sentry at warning level. - error — adds a Sentry breadcrumb (
app.error), captures the event or exception in Sentry at error level, and prints in debug mode.
Registered as the AppLogger singleton via injection.dart.
See also:
- AppLogger for the abstract interface this class implements.
Constructors
- SentryAppLogger()
-
Creates a constant Sentry logger instance.
const
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
-
debug(
String message, {Map< String, Object?> ? extras}) → void -
Logs a debug-level message with optional structured metadata.
override
-
error(
String message, {Object? error, StackTrace? stackTrace, Map< String, Object?> ? extras}) → void -
Logs an error for failures and exceptions.
override
-
info(
String message, {Map< String, Object?> ? extras}) → void -
Logs an informational message with optional structured metadata.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
warn(
String message, {Object? error, StackTrace? stackTrace, Map< String, Object?> ? extras, bool escalate = false}) → void -
Logs a warning for a potentially problematic situation.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited