err 0.2.0 copy "err: ^0.2.0" to clipboard
err: ^0.2.0 copied to clipboard

outdated

A logs router that can pop messages to the device screen. The routes are configurable for each log level.

Err #

pub package api doc

A logs router that can pop messages to the device screen.

Configuration #

Configure the log levels routes: available routes: console, screen or black hole. All the logs routed to the black hole will be silently swallowed: use this to disable a route. All routes default to console.

import 'package:err/err.dart';

var logger = ErrRouter(
   criticalRoute: [ErrRoute.console, ErrRoute.screen],
   errorRoute: [ErrRoute.screen, ErrRoute.console],
   warningRoute: [ErrRoute.screen, ErrRoute.console],
   infoRoute: [ErrRoute.screen],
   debugRoute: [ErrRoute.blackHole]);

Screen route usage #

Flash messages #

The flash messages are toast messages. They stay one second on the screen

@override
void initState() {
   logger.debugFlash(msg: "Init state").then((err) {
      err.show();
    });
    super.initState();
}

Available flash messages:

debugFlash(String msg, Exception or Error errorOrException)

infoFlash(String msg, Exception or Error errorOrException)

Screenshot

Regular messages #

The regular messages are snackbar messages. They need a BuildContext

logger.info(msg: "File uploaded in $elapsed s").then((err) {
   err.show(context);
});

Available messages:

critical(String msg, Exception or Error errorOrException): will stay until dismissed

error(String msg, Exception or Error errorOrException): will stay until dismissed

warning(String msg, Exception or Error errorOrException): will stay for 3 seconds

warningLong(String msg, Exception or Error errorOrException): will stay until dismissed

info(String msg, Exception or Error errorOrException): will stay for 3 seconds

debug(String msg, Exception or Error errorOrException): will stay for 3 seconds

debugLong(String msg, Exception or Error errorOrException): will stay until dismissed

Screenshot

Console route #

Screenshot

By default the terminal output is configured for black and white. If your terminal supports colorized unicode emoticons use this parameter:

var logger = ErrRouter(
   // ...
   terminalColors: true);

Screenshot

Libraries used #

0
likes
0
pub points
46%
popularity

Publisher

unverified uploader

A logs router that can pop messages to the device screen. The routes are configurable for each log level.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

cupertino_icons, flushbar, flutter, fluttertoast

More

Packages that depend on err