Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# package:sentry changelog

## 2.3.0

- Add [breadcrumb](https://docs.sentry.io/development/sdk-dev/event-payloads/breadcrumbs/) support.

## 2.2.0

- Add a `stackFrameFilter` argument to `SentryClient`'s `capture` method (96be842).
Expand Down Expand Up @@ -33,7 +37,7 @@
## 1.0.0

- first and last Dart 1-compatible release (we may fix bugs on a separate branch if there's demand)
- fix code for Dart 2
- fix code for Dart 2

## 0.0.6

Expand Down
39 changes: 37 additions & 2 deletions lib/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -532,27 +532,62 @@ class User {
/// See also:
/// * https://docs.sentry.io/development/sdk-dev/event-payloads/breadcrumbs/
class Breadcrumb {
/// Describes the breadcrumb.
///
/// This field is optional and may be set to null.
final String message;

/// A dot-separated string describing the source of the breadcrumb, e.g. "ui.click".
///
/// This field is optional and may be set to null.
final String category;

/// Data associated with the breadcrumb.
///
/// The contents depend on the [type] of breadcrumb.
///
/// This field is optional and may be set to null.
///
/// See also:
///
/// * https://docs.sentry.io/development/sdk-dev/event-payloads/breadcrumbs/#breadcrumb-types
final Map<String, String> data;

/// Severity of the breadcrumb.
///
/// This field is optional and may be set to null.
final SeverityLevel level;

/// Describes what type of breadcrumb this is.
///
/// Possible values: "default", "http", "navigation".
///
/// This field is optional and may be set to null.
///
/// See also:
///
/// * https://docs.sentry.io/development/sdk-dev/event-payloads/breadcrumbs/#breadcrumb-types
final String type;

/// The time the breadcrumb was recorded.
///
/// This field is required, it must not be null.
///
/// The value is submitted to Sentry with second precision.
final DateTime timestamp;
const Breadcrumb(this.message, this.timestamp,
{this.category, this.data, this.level = SeverityLevel.info, this.type});

/// Creates a breadcrumb that can be attached to an [Event].
const Breadcrumb(
this.message,
this.timestamp, {
this.category,
this.data,
this.level = SeverityLevel.info,
this.type,
}) : assert(timestamp != null);

/// Converts this breadcrumb to a map that can be serialized to JSON according
/// to the Sentry protocol.
Map<String, dynamic> toJson() {
var json = <String, dynamic>{
'timestamp': formatDateAsIso8601WithSecondPrecision(timestamp),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
library version;

/// The SDK version reported to Sentry.io in the submitted events.
const String sdkVersion = '2.2.0';
const String sdkVersion = '2.3.0';

/// The SDK name reported to Sentry.io in the submitted events.
const String sdkName = 'dart';
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sentry
version: 2.2.0
version: 2.3.0
description: A pure Dart Sentry.io client.
author: Flutter Authors <[email protected]>
homepage: https://github.com/flutter/sentry
Expand Down