notice_sentry 2.0.1 copy "notice_sentry: ^2.0.1" to clipboard
notice_sentry: ^2.0.1 copied to clipboard

The official Notice integration for Sentry. The easiest way to send your logs from notice directly to sentry.

Notice integration for Sentry #

For additional information, take a look at the notice package

Example #

final _noticeIntegration = NoticeIntegration();

final mainNotice = Notice(breadcrumb: 'Example', outputs: [_noticeIntegration]);

Future<void> main() async {
  // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io
  const dsn =
      'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562';

  await Sentry.init(
    (options) {
      options.dsn = dsn;
      options.addIntegration(_noticeIntegration);
    },
    appRunner: runApp,
  );
}

Future<void> runApp() async {
  final notice = Notice.childOf(mainNotice, breadcrumb: 'runApp');

  notice.warn('this is a warning!');

  try {
    throw Exception();
  } catch (error, stackTrace) {
    // The log from above will be contained in this crash report.
    await Sentry.captureException(
      error,
      stackTrace: stackTrace,
    );
  }
}
4
likes
150
pub points
47%
popularity

Publisher

unverified uploader

The official Notice integration for Sentry. The easiest way to send your logs from notice directly to sentry.

Repository (GitLab)
View/report issues

Topics

#logging #notice #sentry

Documentation

API reference

License

MIT (license)

Dependencies

notice, sentry

More

Packages that depend on notice_sentry