Skip to content
Prev Previous commit
set the default sdk in SentryOptions
  • Loading branch information
rxlabz committed Oct 27, 2020
commit cce06d72a983da03d491be3e5c57a8c377c8b45a
2 changes: 1 addition & 1 deletion dart/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ abstract class SentryClient {
environment:
event.environment ?? _options.environment ?? defaultEnvironment,
release: event.release ?? _options.release,
sdk: event.sdk ?? Sdk(name: sdkName, version: sdkVersion),
sdk: event.sdk ?? _options.sdk,
platform: event.platform ?? sdkPlatform,
);

Expand Down
9 changes: 7 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class SentryOptions {
/// Sets the release. SDK will try to automatically configure a release out of the box
String release;

// TODO: probably its part of environmentAttributes
/// Sets the environment. This string is freeform and not set by default. A release can be
/// associated with more than one environment to separate them in the UI Think staging vs prod or
/// similar.
Expand Down Expand Up @@ -139,8 +138,14 @@ class SentryOptions {
/// The server name used in the Sentry messages.
String serverName;

Sdk _sdk = Sdk(name: sdkName, version: sdkVersion);

/// Sdk object that contains the Sentry Client Name and its version
Sdk sdk;
Sdk get sdk => _sdk;

set sdk(Sdk sdk) {
_sdk = sdk ?? _sdk;
}

// TODO: Scope observers, enableScopeSync

Expand Down