WalrusLogger class

Configurable logger for the Dartus SDK.

Each WalrusClient and WalrusDirectClient owns a WalrusLogger accessible via its logger property. Configure it at construction time or later:

final client = WalrusClient(
  publisherBaseUrl: publisherUrl,
  aggregatorBaseUrl: aggregatorUrl,
  logLevel: WalrusLogLevel.info, // show info messages and above
);

// Change at runtime
client.logger.level = WalrusLogLevel.debug;

// Route to a custom handler instead of stderr
client.logger.onRecord = (record) {
  print('${record.level}: ${record.message}');
};

// Silence completely
client.logger.level = WalrusLogLevel.none;

Constructors

WalrusLogger({WalrusLogLevel level = WalrusLogLevel.none, WalrusLogHandler? onRecord})
Creates a logger with the given initial level.

Properties

hashCode int
The hash code for this object.
no setterinherited
level WalrusLogLevel
The minimum severity for emitted log records.
getter/setter pair
onRecord WalrusLogHandler?
Optional custom handler. When null, records are printed to stderr.
getter/setter pair
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, {Object? error, StackTrace? stackTrace}) → 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
verbose(String message) → void
Log a verbose trace message.
warning(String message) → void
Log a warning.

Operators

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