leancode_logging 1.2.0

Dart native js
Flutter Android iOS web

Abstract logging utilities

leancode_logging #

Abstract logging utilities for Dart (do not depend on Flutter).

This library is used as a wrapper around desired logging LeanCode library e.g. leancode_logging_flutter.

Using the package in app #

Define a global variable in you app to access the logger:

final bugfender = Bugfender(config.bugfenderKey, config.debugMode); // from leancode_logging_flutter
logger = bugfender;

This will allow you to use logger throughout your application easily, for example:

try {
//do something
} catch (e, s) {
logger.logException(e, s);
}

To see all available methods take a look at API reference.

Using the package in tests #

This package can be used in tests without dependency on Flutter itself. This way you can have your tests running with just Dart without Flutter.

In order to do that you need to override logger variable in test setup. When using mockito you can provide a simple mock, for example:

// define simple mock
class FakeLogger extends Mock implements Logger {}

// and then use in setup:
logger = FakeLogger();
1
likes
80
pub points
51%
popularity

Publisher

leancode.pl

Abstract logging utilities

Homepage

Documentation

API reference

License

Apache 2.0 (LICENSE)

More

Packages that depend on leancode_logging