v1.0.11 sentry only in release, logging in debug

This commit is contained in:
Tibor Bossanyi
2023-02-23 00:14:43 +01:00
parent 3cd584436b
commit 6ac35b67ab
6 changed files with 39 additions and 27 deletions
+6 -5
View File
@@ -1,15 +1,16 @@
import 'package:workouttest_util/util/env.dart';
import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
mixin Logging {
void log(String message) {
DateTime time = DateTime.now();
print(DateFormat('yyyy-MM-dd HH:mm:ss ').format(time) + message);
if ( kDebugMode ) {
DateTime time = DateTime.now();
print(DateFormat('yyyy-MM-dd HH:mm:ss ').format(time) + message);
}
}
void trace(String message) {
String testEnv = EnvironmentConfig.test_env;
if (testEnv == "1") {
if ( kDebugMode ) {
log(message);
}
}
+7
View File
@@ -1,3 +1,4 @@
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:workouttest_util/model/cache.dart';
import 'package:workouttest_util/util/logging.dart';
import 'package:workouttest_util/service/tracking_service.dart';
@@ -50,4 +51,10 @@ class Track with Logging {
}
}
void trackError(Object e) {
if ( kReleaseMode ) {
Sentry.captureException(e);
}
}
}