Remove logging util
This commit is contained in:
parent
914552eeed
commit
32087f79d1
1 changed files with 0 additions and 36 deletions
|
@ -1,36 +0,0 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:archive/archive_io.dart';
|
||||
import 'package:flutter_email_sender/flutter_email_sender.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
class LoggingUtil {
|
||||
LoggingUtil._privateConstructor();
|
||||
|
||||
static final LoggingUtil instance = LoggingUtil._privateConstructor();
|
||||
|
||||
bool _isInProgress = false;
|
||||
Future<void> emailLogs() async {
|
||||
if (_isInProgress) {
|
||||
return;
|
||||
}
|
||||
_isInProgress = true;
|
||||
final tempPath = (await getTemporaryDirectory()).path;
|
||||
final zipFilePath = tempPath + "/logs.zip";
|
||||
Directory logsDirectory = Directory(tempPath + "/logs");
|
||||
var encoder = ZipFileEncoder();
|
||||
encoder.create(zipFilePath);
|
||||
encoder.addDirectory(logsDirectory);
|
||||
encoder.close();
|
||||
final Email email = Email(
|
||||
body: 'Logs attached.',
|
||||
subject: 'Error, error, share the terror.',
|
||||
recipients: ['android-support@ente.io'],
|
||||
cc: ['vishnumohandas@gmail.com'],
|
||||
attachmentPaths: [zipFilePath],
|
||||
isHTML: false,
|
||||
);
|
||||
await FlutterEmailSender.send(email);
|
||||
_isInProgress = false;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue