signale is a simple log package for dart with pure code, inspire from signale.js.
I want a simple log package, and can support color text,no complicated design.
and can get log data, because I want display log data in my app.
you can see from this code
void main() {
Log.defaultLogger.level = LogLevel.info;
Log.d('Debug log');
Log.i('Info log');
Log.w('Warning log');
Log.e('Error log');
Log.v('Verbose log');
Log.c('Color log', 12);
Log.c('Color log', 14);
Log.r('this is random color');
Log.r('this is random color');
Log.r('this is random color');
}
display on Flutter Widget with xterm.dart
Log.w
Log.e
Log.i
Log.v
Log.d
Log.custom
Log.r
Log.defaultLogger.level = LogLevel.info;
you can listen log stream
Log.defaultLogger.stream.listen((event) {
print(event);
});
- implement
Printer
class
abstract class Printable {
void print(DateTime time, Object object);
}
- set
Printer
toLog.defaultLogger.printer
Log.defaultLogger.printer = Printer();