stump 1.0.1 copy "stump: ^1.0.1" to clipboard
stump: ^1.0.1 copied to clipboard

Stump is a Flutter logger inspired by Timber. It provides a set of static methods to easily log messages and the support to multiple and custom printers.

Stump is a Flutter logger inspired by Timber. It provides a set of static methods to easily log messages and the support to multiple and custom printers.

Getting started #

Initialize Stump by adding StumpPrinter implementations to it in the main() of your app. The library come with a printer implementation, DebugPrinter, that prints messages by using debugPrint, with automatic tag inference and color based on log level. You can add as many StumpPrinter as you want.

Example: basic setup #

Stump.addPrinter(DebugPrinter());

Example: DebugPrinter in debug only (no logs in release) #

if (kDebugMode) {
  Stump.addPrinter(DebugPrinter());
}

Example: DebugPrinter in debug and a custom printer in release #

if (kDebugMode) {
  Stump.addPrinter(DebugPrinter());
} else {
  Stump.addPrinter(MyCustomPrinter());
}

Usage #

Stump.i('My info log message');
Stump.d('My debug log message');
Stump.w('My warning log message');
Stump.e('My error log message');

The result, if launched with DebugPrinter installed, will be similar to: Stump DebugPrinter example

You can optionally provide error and stacktrace to errors:

try {
  throw 'A very bad error';
} catch (error, stackTrace) {
  Stump.e('My error log message', error: error, stackTrace: stackTrace);
}
0
likes
135
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

Stump is a Flutter logger inspired by Timber. It provides a set of static methods to easily log messages and the support to multiple and custom printers.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, intl, stack_trace

More

Packages that depend on stump