|
| 1 | +// ignore_for_file: deprecated_member_use_from_same_package |
| 2 | + |
1 | 3 | import 'package:http/http.dart';
|
2 | 4 | import 'package:sentry/sentry.dart';
|
3 | 5 | import 'package:sentry/src/noop_client.dart';
|
@@ -35,15 +37,32 @@ void main() {
|
35 | 37 |
|
36 | 38 | test('SentryLogger sets a diagnostic logger', () {
|
37 | 39 | final options = defaultTestOptions();
|
38 |
| - // ignore: deprecated_member_use_from_same_package |
39 | 40 | expect(options.logger, noOpLogger);
|
40 |
| - // ignore: deprecated_member_use_from_same_package |
41 | 41 | options.logger = dartLogger;
|
42 | 42 |
|
43 |
| - // ignore: deprecated_member_use_from_same_package |
44 | 43 | expect(options.logger, isNot(noOpLogger));
|
45 | 44 | });
|
46 | 45 |
|
| 46 | + test('setting debug correctly sets logger', () { |
| 47 | + final options = defaultTestOptions(); |
| 48 | + expect(options.logger, noOpLogger); |
| 49 | + expect(options.diagnosticLogger, isNull); |
| 50 | + options.debug = true; |
| 51 | + expect(options.logger, isNot(options.debugLogger)); |
| 52 | + expect(options.diagnosticLogger!.logger, options.debugLogger); |
| 53 | + expect(options.logger, options.diagnosticLogger!.log); |
| 54 | + |
| 55 | + options.debug = false; |
| 56 | + expect(options.logger, isNot(noOpLogger)); |
| 57 | + expect(options.diagnosticLogger!.logger, noOpLogger); |
| 58 | + expect(options.logger, options.diagnosticLogger!.log); |
| 59 | + |
| 60 | + options.debug = true; |
| 61 | + expect(options.logger, isNot(options.debugLogger)); |
| 62 | + expect(options.diagnosticLogger!.logger, options.debugLogger); |
| 63 | + expect(options.logger, options.diagnosticLogger!.log); |
| 64 | + }); |
| 65 | + |
47 | 66 | test('tracesSampler is null by default', () {
|
48 | 67 | final options = defaultTestOptions();
|
49 | 68 |
|
@@ -112,15 +131,13 @@ void main() {
|
112 | 131 |
|
113 | 132 | test('when enableTracing is set to true tracing is considered enabled', () {
|
114 | 133 | final options = SentryOptions.empty();
|
115 |
| - // ignore: deprecated_member_use_from_same_package |
116 | 134 | options.enableTracing = true;
|
117 | 135 |
|
118 | 136 | expect(options.isTracingEnabled(), true);
|
119 | 137 | });
|
120 | 138 |
|
121 | 139 | test('when enableTracing is set to false tracing is considered disabled', () {
|
122 | 140 | final options = SentryOptions.empty();
|
123 |
| - // ignore: deprecated_member_use_from_same_package |
124 | 141 | options.enableTracing = false;
|
125 | 142 | options.tracesSampleRate = 1.0;
|
126 | 143 | options.tracesSampler = (_) {
|
|
0 commit comments