rollbar_dart 1.3.2 copy "rollbar_dart: ^1.3.2" to clipboard
rollbar_dart: ^1.3.2 copied to clipboard

Connect your Dart applications to Rollbar for error reporting.

example/lib/example.dart

import 'package:logging/logging.dart' show Logger, Level;
import 'package:rollbar_dart/rollbar.dart' show Rollbar, Config;

/// Command line application example using rollbar-dart.
void main() async {
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((record) =>
      print('${record.level.name}: ${record.time}: ${record.message}'));

  // NOTE: Use your Rollbar Project access token
  await Rollbar.run(Config(
    accessToken: 'YOUR-ROLLBAR-ACCESSTOKEN',
    package: 'rollbar_dart_example',
  ));

  for (var i = 10; i > 0; i--) {
    try {
      throw ArgumentError('$i: An error occurred in the dart example app');
    } catch (error, stackTrace) {
      Rollbar.error(error, stackTrace);
    }
  }

  await Future.delayed(Duration(seconds: 10));
}
2
likes
150
points
960
downloads

Publisher

verified publisherrollbar.com

Weekly Downloads

Connect your Dart applications to Rollbar for error reporting.

Homepage
Repository (GitHub)

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

collection, http, meta, rollbar_common, sqlite3, stack_trace

More

Packages that depend on rollbar_dart