Fix logging levels for Helper.

This commit is contained in:
Dain Nilsson 2022-05-25 16:10:26 +02:00
parent 3e9338395a
commit 579c71d910
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
2 changed files with 18 additions and 5 deletions

View File

@ -36,7 +36,9 @@ class AboutPage extends ConsumerWidget {
const LoggingPanel(),
if (isDesktop) ...[
const Divider(),
OutlinedButton(
OutlinedButton.icon(
icon: const Icon(Icons.healing),
label: const Text('Run diagnostics...'),
onPressed: () async {
_log.info('Running diagnostics...');
final response =
@ -51,7 +53,6 @@ class AboutPage extends ConsumerWidget {
},
);
},
child: const Text('Run diagnostics...'),
),
]
],
@ -85,8 +86,9 @@ class LoggingPanel extends ConsumerWidget {
},
),
const SizedBox(width: 8.0),
OutlinedButton(
child: const Text('Copy log'),
OutlinedButton.icon(
icon: const Icon(Icons.copy),
label: const Text('Copy log'),
onPressed: () async {
_log.info('Copying log to clipboard ($version)...');
final logs = await ref.read(logLevelProvider.notifier).getLogs();

View File

@ -114,7 +114,18 @@ Future<Widget> initialize(List<String> argv) async {
fingerprintProvider.overrideWithProvider(desktopFingerprintProvider),
credentialProvider.overrideWithProvider(desktopCredentialProvider),
],
child: const YubicoAuthenticatorApp(page: MainPage()),
child: YubicoAuthenticatorApp(
page: Consumer(
builder: ((_, ref, child) {
// keep RPC log level in sync with app
ref.listen<Level>(logLevelProvider, (_, level) {
rpc.setLogLevel(level);
});
return const MainPage();
}),
),
),
);
}