v1.0.11 sentry only in release, logging in debug
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user