mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
88cc0caab7
* chore: add dart dependency validator * feat: integrate sentry flutter * chore: remove user info collection * fix: flutter analyze * fix: ios compile * chore: add log
32 lines
708 B
Dart
32 lines
708 B
Dart
import 'package:appflowy/env/env.dart';
|
|
import 'package:appflowy_backend/log.dart';
|
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
|
|
|
import '../startup.dart';
|
|
|
|
class InitSentryTask extends LaunchTask {
|
|
const InitSentryTask();
|
|
|
|
@override
|
|
Future<void> initialize(LaunchContext context) async {
|
|
const dsn = Env.sentryDsn;
|
|
if (dsn.isEmpty) {
|
|
Log.info('Sentry DSN is not set, skipping initialization');
|
|
return;
|
|
}
|
|
|
|
Log.info('Initializing Sentry');
|
|
|
|
await SentryFlutter.init(
|
|
(options) {
|
|
options.dsn = dsn;
|
|
options.tracesSampleRate = 1.0;
|
|
options.profilesSampleRate = 1.0;
|
|
},
|
|
);
|
|
}
|
|
|
|
@override
|
|
Future<void> dispose() async {}
|
|
}
|