AppFlowy/frontend/appflowy_flutter/lib/startup/tasks/sentry.dart
Lucas.Xu d3d929b68e
fix: unable to insert todo list via slash menu (#5980)
* fix: unable to insert todo list via slash menu

* fix: unable to insert divider via slash menu

* chore: update editor version

* chore: update translations

* chore: decrease sentry sample rate to 0.1

* fix: integration test
2024-08-16 11:58:48 +08:00

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 = 0.1;
options.profilesSampleRate = 0.1;
},
);
}
@override
Future<void> dispose() async {}
}