Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
revert environmentAttributes renaming
  • Loading branch information
rxlabz committed Oct 14, 2020
commit f63ac278c1de1251a466920e0bd7d5c082477e34
14 changes: 7 additions & 7 deletions dart/lib/src/browser_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import 'version.dart';

SentryClient createSentryClient({
@required String dsn,
Event environment,
Event environmentAttributes,
bool compressPayload,
Client httpClient,
dynamic clock,
UuidGenerator uuidGenerator,
}) =>
SentryBrowserClient(
dsn: dsn,
environment: environment,
environmentAttributes: environmentAttributes,
httpClient: httpClient,
clock: clock,
uuidGenerator: uuidGenerator,
Expand All @@ -36,7 +36,7 @@ class SentryBrowserClient extends SentryClient {
/// Instantiates a client using [dsn] issued to your project by Sentry.io as
/// the endpoint for submitting events.
///
/// [environment] contain event attributes that do not change over
/// [environmentAttributes] contain event attributes that do not change over
/// the course of a program's lifecycle. These attributes will be added to
/// all events captured via this client. The following attributes often fall
/// under this category: [Event.serverName], [Event.release], [Event.environment].
Expand All @@ -55,7 +55,7 @@ class SentryBrowserClient extends SentryClient {
/// tests.
factory SentryBrowserClient({
@required String dsn,
Event environment,
Event environmentAttributes,
Client httpClient,
dynamic clock,
UuidGenerator uuidGenerator,
Expand All @@ -72,7 +72,7 @@ class SentryBrowserClient extends SentryClient {
httpClient: httpClient,
clock: clock,
uuidGenerator: uuidGenerator,
environment: environment,
environmentAttributes: environmentAttributes,
dsn: dsn,
origin: origin,
platform: browserPlatform,
Expand All @@ -83,15 +83,15 @@ class SentryBrowserClient extends SentryClient {
Client httpClient,
dynamic clock,
UuidGenerator uuidGenerator,
Event environment,
Event environmentAttributes,
String dsn,
String platform,
String origin,
}) : super.base(
httpClient: httpClient,
clock: clock,
uuidGenerator: uuidGenerator,
environment: environment,
environmentAttributes: environmentAttributes,
dsn: dsn,
platform: platform,
origin: origin,
Expand Down
12 changes: 6 additions & 6 deletions dart/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ abstract class SentryClient {
/// `dart:html` is available, otherwise it will throw an unsupported error.
factory SentryClient({
@required String dsn,
Event environment,
Event environmentAttributes,
bool compressPayload,
Client httpClient,
dynamic clock,
UuidGenerator uuidGenerator,
}) =>
createSentryClient(
dsn: dsn,
environment: environment,
environmentAttributes: environmentAttributes,
httpClient: httpClient,
clock: clock,
uuidGenerator: uuidGenerator,
Expand All @@ -43,7 +43,7 @@ abstract class SentryClient {
dynamic clock,
UuidGenerator uuidGenerator,
String dsn,
this.environment,
this.environmentAttributes,
String platform,
this.origin,
Sdk sdk,
Expand Down Expand Up @@ -71,7 +71,7 @@ abstract class SentryClient {
/// event to event, such as local operating system version, the version of
/// Dart/Flutter SDK, etc. These attributes have lower precedence than those
/// supplied in the even passed to [capture].
final Event environment;
final Event environmentAttributes;

final Dsn _dsn;

Expand Down Expand Up @@ -155,8 +155,8 @@ abstract class SentryClient {
'timestamp': formatDateAsIso8601WithSecondPrecision(now),
};

if (environment != null) {
mergeAttributes(environment.toJson(), into: data);
if (environmentAttributes != null) {
mergeAttributes(environmentAttributes.toJson(), into: data);
}

// Merge the user context.
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/client_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'utils.dart';
/// Implemented in `browser_client.dart` and `io_client.dart`.
SentryClient createSentryClient({
@required String dsn,
Event environment,
Event environmentAttributes,
bool compressPayload,
Client httpClient,
dynamic clock,
Expand Down
14 changes: 7 additions & 7 deletions dart/lib/src/io_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import 'version.dart';

SentryClient createSentryClient({
@required String dsn,
Event environment,
Event environmentAttributes,
bool compressPayload,
Client httpClient,
dynamic clock,
UuidGenerator uuidGenerator,
}) =>
SentryIOClient(
dsn: dsn,
environment: environment,
environmentAttributes: environmentAttributes,
compressPayload: compressPayload,
httpClient: httpClient,
clock: clock,
Expand All @@ -36,7 +36,7 @@ class SentryIOClient extends SentryClient {
/// Instantiates a client using [dsn] issued to your project by Sentry.io as
/// the endpoint for submitting events.
///
/// [environment] contain event attributes that do not change over
/// [environmentAttributes] contain event attributes that do not change over
/// the course of a program's lifecycle. These attributes will be added to
/// all events captured via this client. The following attributes often fall
/// under this category: [Event.serverName], [Event.release], [Event.environment].
Expand All @@ -59,7 +59,7 @@ class SentryIOClient extends SentryClient {
/// tests.
factory SentryIOClient({
@required String dsn,
Event environment,
Event environmentAttributes,
bool compressPayload,
Client httpClient,
dynamic clock,
Expand All @@ -74,7 +74,7 @@ class SentryIOClient extends SentryClient {
httpClient: httpClient,
clock: clock,
uuidGenerator: uuidGenerator,
environment: environment,
environmentAttributes: environmentAttributes,
dsn: dsn,
compressPayload: compressPayload,
platform: sdkPlatform,
Expand All @@ -85,7 +85,7 @@ class SentryIOClient extends SentryClient {
Client httpClient,
dynamic clock,
UuidGenerator uuidGenerator,
Event environment,
Event environmentAttributes,
String dsn,
this.compressPayload = true,
String platform,
Expand All @@ -94,7 +94,7 @@ class SentryIOClient extends SentryClient {
httpClient: httpClient,
clock: clock,
uuidGenerator: uuidGenerator,
environment: environment,
environmentAttributes: environmentAttributes,
dsn: dsn,
platform: platform,
origin: origin,
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Sentry {
optionsConfiguration(options);
_client = SentryClient(
dsn: options.dsn,
environment: options.environment,
environmentAttributes: options.environmentAttributes,
compressPayload: options.compressPayload,
httpClient: options.httpClient,
clock: options.clock,
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentryOptions {
/// event to event, such as local operating system version, the version of
/// Dart/Flutter SDK, etc. These attributes have lower precedence than those
/// supplied in the even passed to [capture].
Event environment;
Event environmentAttributes;

/// If [compressPayload] is `true` the outgoing HTTP payloads are compressed
/// using gzip. Otherwise, the payloads are sent in plain UTF8-encoded JSON
Expand All @@ -44,7 +44,7 @@ class SentryOptions {

SentryOptions({
this.dsn,
this.environment,
this.environmentAttributes,
this.compressPayload,
this.httpClient,
this.clock,
Expand Down
8 changes: 4 additions & 4 deletions dart/test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Future testCaptureException(
clock: fakeClockProvider,
uuidGenerator: () => 'X' * 32,
compressPayload: compressPayload,
environment: const Event(
environmentAttributes: const Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down Expand Up @@ -235,7 +235,7 @@ void runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false}) {
clock: fakeClockProvider,
compressPayload: false,
uuidGenerator: () => 'X' * 32,
environment: const Event(
environmentAttributes: const Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down Expand Up @@ -293,7 +293,7 @@ void runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false}) {
clock: fakeClockProvider,
uuidGenerator: () => 'X' * 32,
compressPayload: false,
environment: const Event(
environmentAttributes: const Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down Expand Up @@ -350,7 +350,7 @@ void runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false}) {
clock: fakeClockProvider,
uuidGenerator: () => 'X' * 32,
compressPayload: false,
environment: const Event(
environmentAttributes: const Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down