BugReport: Send bug reports with new logs

Earlier we used to call 'adb logcat' and get all the logs and send
those. This didn't work on iOS and we wouldn't get all the logs even in
android at times as the logcat buffer can be unreliable.

Since now we log all the messages to a file, we can just send that file.
The disadvtange is that we only get Dart level logs, and not iOS or Java
or NDK or our C libraries logs.

I should really dump libgit2 ASAP.
This commit is contained in:
Vishesh Handa
2020-05-31 02:42:58 +02:00
parent 68d3aa1a2b
commit 2a35ea7c38
4 changed files with 6 additions and 15 deletions

View File

@ -130,6 +130,11 @@ class Log {
}
}
}
static String filePathForDate(DateTime dt) {
var date = dt.toString().substring(0, 10);
return p.join(logFolderPath, '$date.jsonl');
}
}
class LogMessage {

View File

@ -9,7 +9,6 @@ import 'package:launch_review/launch_review.dart';
import 'package:provider/provider.dart';
import 'package:share/share.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:fetch_app_logs/fetch_app_logs.dart';
import 'package:gitjournal/analytics.dart';
import 'package:gitjournal/state_container.dart';
@ -165,12 +164,7 @@ class AppDrawer extends StatelessWidget {
onTap: () async {
var platform = Platform.operatingSystem;
var versionText = await getVersionString();
String appLogsFilePath;
try {
appLogsFilePath = await FetchAppLogs.dumpAppLogsToFile();
} catch (e) {
print(e);
}
var appLogsFilePath = Log.filePathForDate(DateTime.now());
final Email email = Email(
body:

View File

@ -199,13 +199,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
fetch_app_logs:
dependency: "direct main"
description:
name: fetch_app_logs
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
file:
dependency: transitive
description:

View File

@ -34,7 +34,6 @@ dependencies:
dart_git:
git: https://github.com/GitJournal/dart_git.git
#path: /Users/vishesh/src/gitjournal/dart_git
fetch_app_logs: ^0.0.3
flutter_runtime_env: ^0.0.2
yaml_serializer: ^0.0.6
connectivity: ^0.4.6+1