tracker_logger_bundle 0.0.2 copy "tracker_logger_bundle: ^0.0.2" to clipboard
tracker_logger_bundle: ^0.0.2 copied to clipboard

A bundle of info, event and error trackers and loggers to speed up development and debugging.

example/example.md

Example #

Getting started #

The simplest way to initialize the Loggers is to initialize the instance on app start. This is best done in main.dart like so:

Future<void> main() async {
    // ...

    Log.instance.initialize();
    
    // ...
}

Add the plugins you like to the initialize function. As a default it only uses the local logger.

If you are using a zoned guard, you can wrap the initialization around your app runner.

In main.dart use the following inside a runZonedGuarded:

Future<void> main() async {
  runZonedGuarded<Future<void>>(
    () async {
      WidgetsFlutterBinding.ensureInitialized();

      await Log.instance.initialize(
        matomoOptions: const MatomoOptions(siteId: 69, url: 'your matomo url'),
        sentryConfig: SentryConfig(
          optionsConfiguration: (options) {
            // options.dsn = kDebugMode ? '' : F.sentryKey;
            // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
            // We recommend adjusting this value in production.
            options.tracesSampleRate = 1.0;
          },
          appRunner: () => runApp(
            const AppEntry(),
          ),
        ),
      );
    },
    // This logs to all plugins you specified
    (error, stack) async => Log.instance.logError(
      'Uncaught error in zonedGuarded',
      error: error,
      stackTrace: stack,
    ),
  );
}
1
likes
150
pub points
44%
popularity

Publisher

unverified uploader

A bundle of info, event and error trackers and loggers to speed up development and debugging.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

device_info_plus, firebase_analytics, firebase_crashlytics, flutter, http, logger, matomo_tracker, package_info_plus, sentry_flutter, shared_preferences

More

Packages that depend on tracker_logger_bundle