Add app version to log/diagnostics output.

This commit is contained in:
Dain Nilsson 2022-05-17 09:10:23 +02:00
parent fdaf3dbf57
commit 5cd0ef9ee4
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8

View File

@ -41,7 +41,8 @@ class AboutPage extends ConsumerWidget {
_log.info('Running diagnostics...');
final response =
await ref.read(rpcProvider).command('diagnose', []);
final data = response['diagnostics'];
final data = response['diagnostics'] as List;
data.insert(0, {'app_version': version});
final text = const JsonEncoder.withIndent(' ').convert(data);
await Clipboard.setData(ClipboardData(text: text));
await ref.read(withContextProvider)(
@ -87,7 +88,7 @@ class LoggingPanel extends ConsumerWidget {
OutlinedButton(
child: const Text('Copy log'),
onPressed: () async {
_log.info('Copying log to clipboard...');
_log.info('Copying log to clipboard ($version)...');
final logs = await ref.read(logLevelProvider.notifier).getLogs();
await Clipboard.setData(ClipboardData(text: logs.join('\n')));
await ref.read(withContextProvider)(