Interface used by log printers for use with the SDK. A custom implementation can be used to adapt the SDK log output to a logging framework of your choice.
For instance an adapter for logger may look like the following.
class MyLoggerAdapter implements LDLogAdapter {
final Logger _logger;
MyLoggerAdapter(this._logger);
log(LDLogRecord record) {
final formatted ='[${record.logTag}] ${record.level} ${record.time}: ${record.message}';
switch(record.level) {
case LDLogLevel.none:
break;
case LDLogLevel.debug:
_logger.d(formatted);
break;
case LDLogLevel.info:
_logger.i(formatted);
break;
case LDLogLevel.warn:
_logger.w(formatted);
break;
case LDLogLevel.error:
_logger.e(formatted);
}
}
}
- Implementers
Constructors
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
-
log(
LDLogRecord record) → void - Handle a log record emitted by the logger. This can be used to control the output of SDK log messages.
-
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