Logger for Crispin
Using Logger
Features
Because Logger doesn't follow RFC5424 with ascension, LoggerCrispinTransport
maps log levels as the following:
Logger Method | Crispin Method | RFC5424 level | Logger value |
---|---|---|---|
e | error | 0 | 4 |
w | warn | 1 | 3 |
i | info | 2 | 2 |
d | debug | 5 | 1 |
v | verbose | 4 | 0 |
wtf / wtf | Not mapped | - | 5 |
Getting started
- Install
flutter pub add logger_crispin_transport
ordart pub add logger_crispin_transport
- Add the transport to Crispin as the below Usage section shows
Usage
import 'package:crispin/crispin.dart';
import 'package:logger_crispin_transport/logger_crispin_transport.dart';
void main() {
Crispin().addTransport(LoggerCrispinTransport(LoggerCrispinTransportOptions(level: 'warn')));
}
Please see /example
folder and docs for more examples and please see the docs for more information on usage.