NetworkLogger class

Pluggable logger used across the entire plugin.

// Silence all logs
final manager = NetworkManager(
  logger: NetworkLogger.silent,
);

// Provide a custom logger (e.g. to forward to Crashlytics)
final manager = NetworkManager(
  logger: NetworkLogger.custom((level, message) {
    FirebaseCrashlytics.instance.log('[$level] $message');
  }),
);

Constructors

NetworkLogger.custom(void _handler(LogLevel level, String message), {LogLevel minLevel = LogLevel.debug})
Creates a logger with a custom handler.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
minLevel LogLevel
Minimum log level to forward. Messages below this are dropped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

debug(String message) → void
Log a debug message.
error(String message) → void
Log an error.
info(String message) → void
Log an informational message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
warning(String message) → void
Log a warning.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

defaultLogger NetworkLogger
The default logger that prints to stdout.
final
silent NetworkLogger
A silent logger that discards all messages.
final