logging_bugfender 5.0.0+1 copy "logging_bugfender: ^5.0.0+1" to clipboard
logging_bugfender: ^5.0.0+1 copied to clipboard

A library helping integrate Bugfender with the logging package.

Banner

logging_bugfender #

logging_bugfender pub.dev badge

A library helping integrate Bugfender with the logging package.

Usage #

Setup #

final loggingListener = LoggingBugfenderListener('my-very-secret-app-key');

void main() {
    setupLogger(true);
    // ...
    runApp(MyApp());
}

void setupLogger(bool debugMode) {
  if (debugMode) {
    // During debugging, you'll usually want to log everything
    Logger.root.level = Level.ALL;
    LoggingBugfenderListener(
      config.bugfenderKey,
      consolePrintStrategy: const PlainTextPrintStrategy(),
    ).listen(Logger.root);
  } else {
    // On production, you probably want to log only INFO and above
    Logger.root.level = Level.INFO;
    LoggingBugfenderListener(config.bugfenderKey).listen(Logger.root);
  }
}

Custom data #

You can also add and remove custom data.

const logUsernameKey = 'username';

// After the user signs in
loggingListener.setCustomData(logUsernameKey, '<some username>');

// After the user signs out
loggingListener.removeCustomData(logUsernameKey);

In a cubit #

class FooBarCubit {
    final _logger = Logger('FooBarCubit');

    // (...)

    void doSomething() {
        try {
            // (...)
            _logger.info('Successfuly did something');
        } catch (err, st) {
            _logger.severe('Failed doing something', err, st);
        }
    }
}

🛠️ Maintained by LeanCode #

LeanCode Logo

This package is built with 💙 by LeanCode. We are top-tier experts focused on Flutter Enterprise solutions.

Why LeanCode? #

  • Creators of Patrol – the next-gen testing framework for Flutter.

  • Production-Ready – We use this package in apps with millions of users.

  • Full-Cycle Product Development – We take your product from scratch to long-term maintenance.


Need help with your Flutter project?

👉 Hire our team   •   Check our other packages

10
likes
150
points
570
downloads

Publisher

verified publisherleancode.co

Weekly Downloads

A library helping integrate Bugfender with the logging package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter_bugfender, logging

More

Packages that depend on logging_bugfender