refactor: remove useless prints.

This commit is contained in:
Aunali321 2022-10-16 23:54:07 +05:30
parent fbd4359d61
commit 1a97cdf91d
2 changed files with 3 additions and 9 deletions

View File

@ -25,7 +25,7 @@ Future main() async {
await locator<RevancedAPI>().initialize(apiUrl); await locator<RevancedAPI>().initialize(apiUrl);
bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled(); bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled();
bool isCrashlyticsEnabled = locator<ManagerAPI>().isCrashlyticsEnabled(); bool isCrashlyticsEnabled = locator<ManagerAPI>().isCrashlyticsEnabled();
// Remove this line if you are building from source and don't have firebase config // Remove this section if you are building from source and don't have firebase config
if (isCrashlyticsEnabled) { if (isCrashlyticsEnabled) {
await Firebase.initializeApp( await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform, options: DefaultFirebaseOptions.currentPlatform,
@ -41,11 +41,11 @@ Future main() async {
await locator<PatcherAPI>().initialize(); await locator<PatcherAPI>().initialize();
tz.initializeTimeZones(); tz.initializeTimeZones();
// Remove this line if you are building from source and don't have sentry configured // Remove this section if you are building from source and don't have sentry configured
await SentryFlutter.init( await SentryFlutter.init(
(options) { (options) {
options options
..dsn = isSentryEnabled ? Env.sentry_dsn : '' ..dsn = isSentryEnabled ? Env.sentryDSN : ''
..environment = 'alpha' ..environment = 'alpha'
..release = '0.1' ..release = '0.1'
..tracesSampleRate = 1.0 ..tracesSampleRate = 1.0
@ -53,18 +53,14 @@ Future main() async {
..enableOutOfMemoryTracking = true ..enableOutOfMemoryTracking = true
..sampleRate = isSentryEnabled ? 1.0 : 0.0 ..sampleRate = isSentryEnabled ? 1.0 : 0.0
..beforeSend = (event, hint) { ..beforeSend = (event, hint) {
print('isSentryEnabled: $isSentryEnabled');
if (isSentryEnabled) { if (isSentryEnabled) {
print("Sentry event sent");
return event; return event;
} else { } else {
print("Sentry is disabled");
return null; return null;
} }
} as BeforeSendCallback?; } as BeforeSendCallback?;
}, },
appRunner: () { appRunner: () {
// Pass all uncaught errors from the framework to Crashlytics.
if (isCrashlyticsEnabled) { if (isCrashlyticsEnabled) {
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
} }

View File

@ -88,7 +88,6 @@ class ManagerAPI {
Future<void> setSentryStatus(bool value) async { Future<void> setSentryStatus(bool value) async {
await _prefs.setBool('sentryEnabled', value); await _prefs.setBool('sentryEnabled', value);
print('Sentry status: $value');
} }
bool isCrashlyticsEnabled() { bool isCrashlyticsEnabled() {
@ -97,7 +96,6 @@ class ManagerAPI {
Future<void> setCrashlyticsStatus(bool value) async { Future<void> setCrashlyticsStatus(bool value) async {
await _prefs.setBool('crashlyticsEnabled', value); await _prefs.setBool('crashlyticsEnabled', value);
print('Crashlytics status: $value');
} }
List<PatchedApplication> getPatchedApps() { List<PatchedApplication> getPatchedApps() {