From 488b1189ad9763f58ec2899402c3f2fa1d378a1a Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Tue, 3 May 2022 11:24:25 +0200 Subject: [PATCH] Use "standard" log level names. --- lib/about_page.dart | 4 +-- lib/android/command_providers.dart | 5 ++-- lib/android/oath/state.dart | 23 +++++++------- lib/app/logging.dart | 33 ++++++++++++++++---- lib/app/state.dart | 3 +- lib/desktop/devices.dart | 11 +++---- lib/desktop/fido/state.dart | 3 +- lib/desktop/init.dart | 5 ++-- lib/desktop/management/state.dart | 3 +- lib/desktop/oath/state.dart | 23 +++++++------- lib/desktop/rpc.dart | 35 ++++++++-------------- lib/desktop/state.dart | 5 ++-- lib/fido/views/add_fingerprint_dialog.dart | 5 ++-- lib/fido/views/reset_dialog.dart | 3 +- lib/oath/views/add_account_page.dart | 3 +- lib/settings_page.dart | 3 +- 16 files changed, 97 insertions(+), 70 deletions(-) diff --git a/lib/about_page.dart b/lib/about_page.dart index dcd64edf..19f9bd50 100755 --- a/lib/about_page.dart +++ b/lib/about_page.dart @@ -66,7 +66,7 @@ class LoggingPanel extends ConsumerWidget { DropdownButton( value: ref.watch(logLevelProvider), isDense: true, - items: [Level.WARNING, Level.INFO, Level.CONFIG, Level.FINE] + items: Levels.LEVELS .map((e) => DropdownMenuItem( value: e, child: Text(e.name.toUpperCase()), @@ -74,7 +74,7 @@ class LoggingPanel extends ConsumerWidget { .toList(), onChanged: (level) { ref.read(logLevelProvider.notifier).setLogLevel(level!); - _log.config('Log level set to $level'); + _log.debug('Log level set to $level'); showMessage(context, 'Log level set to $level'); }, ), diff --git a/lib/android/command_providers.dart b/lib/android/command_providers.dart index babb7182..e523cf3f 100644 --- a/lib/android/command_providers.dart +++ b/lib/android/command_providers.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; import 'package:yubico_authenticator/android/oath/command_providers.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../app/models.dart'; import '../core/models.dart'; @@ -22,7 +23,7 @@ class _YubikeyProvider extends StateNotifier { void setFromString(String input) { try { if (input.isEmpty) { - _log.config('Yubikey was detached.'); + _log.debug('Yubikey was detached.'); state = null; // reset other providers when YubiKey is removed @@ -46,7 +47,7 @@ class _YubikeyProvider extends StateNotifier { deviceInfo); state = YubiKeyData(deviceNode, name, deviceInfo); } on Exception catch (e) { - _log.config('Invalid data for yubikey: $input. $e'); + _log.debug('Invalid data for yubikey: $input. $e'); state = null; } } diff --git a/lib/android/oath/state.dart b/lib/android/oath/state.dart index 5fc9e619..846c4fc7 100755 --- a/lib/android/oath/state.dart +++ b/lib/android/oath/state.dart @@ -7,6 +7,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; import 'package:yubico_authenticator/android/api/impl.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import 'package:yubico_authenticator/app/models.dart'; import 'package:yubico_authenticator/app/state.dart'; import 'package:yubico_authenticator/core/models.dart'; @@ -45,7 +46,7 @@ class _AndroidOathStateNotifier extends OathStateNotifier { .copyWith(locked: false, remembered: false, hasKey: false)); _ref.refresh(androidStateProvider); } catch (e) { - _log.config('Calling reset failed with exception: $e'); + _log.debug('Calling reset failed with exception: $e'); } } @@ -59,7 +60,7 @@ class _AndroidOathStateNotifier extends OathStateNotifier { final remembered = unlockResponse.isRemembered == true; if (unlocked) { - _log.config('applet unlocked'); + _log.debug('applet unlocked'); setData(state.value!.copyWith( locked: false, remembered: remembered, @@ -67,7 +68,7 @@ class _AndroidOathStateNotifier extends OathStateNotifier { } return Pair(unlocked, remembered); } on PlatformException catch (e) { - _log.config('Calling unlock failed with exception: $e'); + _log.debug('Calling unlock failed with exception: $e'); return Pair(false, false); } } @@ -79,7 +80,7 @@ class _AndroidOathStateNotifier extends OathStateNotifier { setData(state.value!.copyWith(hasKey: true)); return true; } on PlatformException catch (e) { - _log.config('Calling set password failed with exception: $e'); + _log.debug('Calling set password failed with exception: $e'); return false; } } @@ -91,7 +92,7 @@ class _AndroidOathStateNotifier extends OathStateNotifier { setData(state.value!.copyWith(hasKey: false, locked: false)); return true; } on PlatformException catch (e) { - _log.config('Calling unset password failed with exception: $e'); + _log.debug('Calling unset password failed with exception: $e'); return false; } } @@ -102,7 +103,7 @@ class _AndroidOathStateNotifier extends OathStateNotifier { await _api.forgetPassword(); setData(state.value!.copyWith(remembered: false)); } on PlatformException catch (e) { - _log.config('Calling forgetPassword failed with exception: $e'); + _log.debug('Calling forgetPassword failed with exception: $e'); } } } @@ -162,7 +163,7 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier { var resultJson = await _api.calculate(credential.id); var result = jsonDecode(resultJson); code = OathCode.fromJson(result); - _log.config('Calculate', jsonEncode(code)); + _log.debug('Calculate', jsonEncode(code)); if (update && mounted) { final creds = state!.toList(); final i = creds.indexWhere((e) => e.credential.id == credential.id); @@ -219,7 +220,7 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier { return renamedCredential; } on PlatformException catch (e) { - _log.config('Failed to execute renameOathCredential: ${e.message}'); + _log.debug('Failed to execute renameOathCredential: ${e.message}'); } return credential; @@ -234,13 +235,13 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier { state = state!.toList()..removeWhere((e) => e.credential == credential); } } catch (e) { - _log.config('Call to delete credential failed: $e'); + _log.debug('Call to delete credential failed: $e'); } } refresh() async { if (_currentDevice == null) return; - _log.config('refreshing credentials...'); + _log.debug('refreshing credentials...'); final pairs = []; @@ -269,7 +270,7 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier { _scheduleRefresh(); } } catch (e) { - _log.config('Failure refreshing codes: $e'); + _log.debug('Failure refreshing codes: $e'); } } diff --git a/lib/app/logging.dart b/lib/app/logging.dart index f6fd8b46..35d39e4d 100755 --- a/lib/app/logging.dart +++ b/lib/app/logging.dart @@ -2,15 +2,38 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +class Levels { + /// Key for tracing information ([value] = 500). + static const Level TRAFFIC = Level('TRAFFIC', 500); + + /// Key for static configuration messages ([value] = 700). + static const Level DEBUG = Level('DEBUG', 700); + + /// Key for informational messages ([value] = 800). + static const Level INFO = Level.INFO; + + /// Key for potential problems ([value] = 900). + static const Level WARNING = Level.WARNING; + + /// Key for serious failures ([value] = 1000). + static const Level ERROR = Level('ERROR', 1000); + + static const List LEVELS = [ + TRAFFIC, + DEBUG, + INFO, + WARNING, + ERROR, + ]; +} + extension LoggerExt on Logger { - void critical(Object? message, [Object? error, StackTrace? stackTrace]) => - shout(message, error, stackTrace); void error(Object? message, [Object? error, StackTrace? stackTrace]) => - severe(message, error, stackTrace); + log(Levels.ERROR, message, error, stackTrace); void debug(Object? message, [Object? error, StackTrace? stackTrace]) => - config(message, error, stackTrace); + log(Levels.DEBUG, message, error, stackTrace); void traffic(Object? message, [Object? error, StackTrace? stackTrace]) => - fine(message, error, stackTrace); + log(Levels.TRAFFIC, message, error, stackTrace); } final logLevelProvider = diff --git a/lib/app/state.dart b/lib/app/state.dart index ac6f599b..f61e135a 100755 --- a/lib/app/state.dart +++ b/lib/app/state.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../core/state.dart'; import 'models.dart'; @@ -28,7 +29,7 @@ class ThemeModeNotifier extends StateNotifier { ThemeModeNotifier(this._prefs) : super(_fromName(_prefs.getString(_key))); void setThemeMode(ThemeMode mode) { - _log.config('Set theme to $mode'); + _log.debug('Set theme to $mode'); state = mode; _prefs.setString(_key, mode.name); } diff --git a/lib/desktop/devices.dart b/lib/desktop/devices.dart index fc84b1a9..4b7bb0b5 100755 --- a/lib/desktop/devices.dart +++ b/lib/desktop/devices.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../app/models.dart'; import '../app/state.dart'; @@ -36,7 +37,7 @@ class UsbDeviceNotifier extends StateNotifier> { UsbDeviceNotifier(this._rpc) : super([]); void refresh() { - _log.config('Refreshing all USB devics'); + _log.debug('Refreshing all USB devics'); _usbState = -1; _pollDevices(); } @@ -106,7 +107,7 @@ class UsbDeviceNotifier extends StateNotifier> { } } } on RpcError catch (e) { - _log.severe('Error polling USB', jsonEncode(e)); + _log.error('Error polling USB', jsonEncode(e)); } if (mounted) { @@ -163,7 +164,7 @@ class NfcDeviceNotifier extends StateNotifier> { .toList(); } } on RpcError catch (e) { - _log.severe('Error polling NFC', jsonEncode(e)); + _log.error('Error polling NFC', jsonEncode(e)); } if (mounted) { @@ -249,7 +250,7 @@ class CurrentDeviceDataNotifier extends StateNotifier { _pollTimer?.cancel(); final node = _deviceNode!; try { - _log.config('Polling for USB device changes...'); + _log.debug('Polling for USB device changes...'); var result = await _rpc.command('get', node.path.segments); if (mounted) { if (result['data']['present']) { @@ -260,7 +261,7 @@ class CurrentDeviceDataNotifier extends StateNotifier { } } } on RpcError catch (e) { - _log.severe('Error polling NFC', jsonEncode(e)); + _log.error('Error polling NFC', jsonEncode(e)); } if (mounted) { _pollTimer = Timer( diff --git a/lib/desktop/fido/state.dart b/lib/desktop/fido/state.dart index d754e95c..f55675d0 100755 --- a/lib/desktop/fido/state.dart +++ b/lib/desktop/fido/state.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../../app/models.dart'; import '../../fido/models.dart'; @@ -66,7 +67,7 @@ class _DesktopFidoStateNotifier extends FidoStateNotifier { Future refresh() => updateState(() async { final result = await _session.command('get'); - _log.config('application status', jsonEncode(result)); + _log.debug('application status', jsonEncode(result)); return FidoState.fromJson(result['data']); }); diff --git a/lib/desktop/init.dart b/lib/desktop/init.dart index 8b55e05f..3286e5ed 100755 --- a/lib/desktop/init.dart +++ b/lib/desktop/init.dart @@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:window_manager/window_manager.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../app/app.dart'; import '../app/views/main_page.dart'; @@ -119,12 +120,12 @@ void _initLogging(List argv) { if (logLevelIndex != -1) { try { final levelName = argv[logLevelIndex + 1]; - Level level = Level.LEVELS + Level level = Levels.LEVELS .firstWhere((level) => level.name == levelName.toUpperCase()); Logger.root.level = level; _log.info('Log level initialized from command line argument'); } catch (error) { - _log.severe('Failed to set log level', error); + _log.error('Failed to set log level', error); } } diff --git a/lib/desktop/management/state.dart b/lib/desktop/management/state.dart index 932431e1..465bbfd2 100755 --- a/lib/desktop/management/state.dart +++ b/lib/desktop/management/state.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import 'package:yubico_authenticator/management/models.dart'; import '../../app/models.dart'; @@ -56,7 +57,7 @@ class _DesktopManagementStateNotifier extends ManagementStateNotifier { try { await _session.command('get', target: path); _subpath = path; - _log.config('Using transport $iface for management'); + _log.debug('Using transport $iface for management'); return info; } catch (e) { _log.warning('Failed connecting to management via $iface'); diff --git a/lib/desktop/oath/state.dart b/lib/desktop/oath/state.dart index 7e3f1631..ee182b3c 100755 --- a/lib/desktop/oath/state.dart +++ b/lib/desktop/oath/state.dart @@ -4,6 +4,7 @@ import 'dart:math'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import 'package:yubico_authenticator/app/views/user_interaction.dart'; import '../../app/models.dart'; @@ -72,7 +73,7 @@ class _DesktopOathStateNotifier extends OathStateNotifier { refresh() => updateState(() async { final result = await _session.command('get'); - _log.config('application status', jsonEncode(result)); + _log.debug('application status', jsonEncode(result)); var oathState = OathState.fromJson(result['data']); final key = _ref.read(_oathLockKeyProvider(_session.devicePath)); if (oathState.locked && key != null) { @@ -107,7 +108,7 @@ class _DesktopOathStateNotifier extends OathStateNotifier { final bool valid = validate['valid']; final bool remembered = validate['remembered']; if (valid) { - _log.config('applet unlocked'); + _log.debug('applet unlocked'); _ref.read(_oathLockKeyProvider(_session.devicePath).notifier).setKey(key); setData(state.value!.copyWith( locked: false, @@ -148,7 +149,7 @@ class _DesktopOathStateNotifier extends OathStateNotifier { await _session.command('set_key', params: {'key': key}); _ref.read(_oathLockKeyProvider(_session.devicePath).notifier).setKey(key); } - _log.config('OATH key set'); + _log.debug('OATH key set'); if (!oathState.hasKey) { setData(oathState.copyWith(hasKey: true)); @@ -231,7 +232,7 @@ class _DesktopCredentialListNotifier extends OathCredentialListNotifier { @override void dispose() { - _log.config('OATH notifier discarded'); + _log.debug('OATH notifier discarded'); _timer?.cancel(); super.dispose(); } @@ -269,7 +270,7 @@ class _DesktopCredentialListNotifier extends OathCredentialListNotifier { target: ['accounts', credential.id], signal: signaler); code = OathCode.fromJson(result); } - _log.config('Calculate', jsonEncode(code)); + _log.debug('Calculate', jsonEncode(code)); if (update && mounted) { final creds = state!.toList(); final i = creds.indexWhere((e) => e.credential.id == credential.id); @@ -333,9 +334,9 @@ class _DesktopCredentialListNotifier extends OathCredentialListNotifier { refresh() async { if (_locked) return; - _log.config('refreshing credentials...'); + _log.debug('refreshing credentials...'); var result = await _session.command('calculate_all', target: ['accounts']); - _log.config('Entries', jsonEncode(result)); + _log.debug('Entries', jsonEncode(result)); final pairs = []; for (var e in result['entries']) { @@ -368,7 +369,7 @@ class _DesktopCredentialListNotifier extends OathCredentialListNotifier { _timer?.cancel(); if (_locked) return; if (state == null) { - _log.config('No OATH state, refresh immediately'); + _log.debug('No OATH state, refresh immediately'); refresh(); } else if (mounted) { final expirations = (state ?? []) @@ -379,16 +380,16 @@ class _DesktopCredentialListNotifier extends OathCredentialListNotifier { .whereType() .map((e) => e.validTo); if (expirations.isEmpty) { - _log.config('No expirations, no refresh'); + _log.debug('No expirations, no refresh'); _timer = null; } else { final earliest = expirations.reduce(min) * 1000; final now = DateTime.now().millisecondsSinceEpoch; if (earliest < now) { - _log.config('Already expired, refresh immediately'); + _log.debug('Already expired, refresh immediately'); refresh(); } else { - _log.config('Schedule refresh in ${earliest - now}ms'); + _log.debug('Schedule refresh in ${earliest - now}ms'); _timer = Timer(Duration(milliseconds: earliest - now), refresh); } } diff --git a/lib/desktop/rpc.dart b/lib/desktop/rpc.dart index 179d1781..2d93ed2b 100644 --- a/lib/desktop/rpc.dart +++ b/lib/desktop/rpc.dart @@ -64,7 +64,7 @@ class _RpcConnection { try { return RpcResponse.fromJson(jsonDecode(event)); } catch (e) { - _log.severe('Response was not valid JSON', event); + _log.error('Response was not valid JSON', event); return RpcResponse.error('invalid-response', e.toString(), {}); } })); @@ -105,7 +105,7 @@ class RpcSession { Future initialize() async { final process = await Process.start(executable, []); - _log.config('RPC process started'); + _log.debug('RPC process started'); process.stderr .transform(const Utf8Decoder()) .transform(const LineSplitter()) @@ -133,7 +133,7 @@ class RpcSession { // Bind to random port final server = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0); final port = server.port; - _log.config('Listening for RPC connection on $port'); + _log.debug('Listening for RPC connection on $port'); // Launch the elevated process final process = @@ -153,12 +153,12 @@ class RpcSession { _log.warning('Failed to elevate RPC process', error); return false; } - _log.config('Elevated RPC process started'); + _log.debug('Elevated RPC process started'); // Accept only a single connection final client = await server.first; await server.close(); - _log.config('Client connected: $client'); + _log.debug('Client connected: $client'); // Stop the old subprocess. try { @@ -174,7 +174,7 @@ class RpcSession { // The nonce needs to be received first. if (!authenticated) { if (nonce == line) { - _log.config('Client authenticated with correct nonce'); + _log.debug('Client authenticated with correct nonce'); authenticated = true; completer.complete(); return ''; @@ -213,22 +213,13 @@ class RpcSession { return request.completer.future; } - setLogLevel(Level level) { - String pyLevel; - if (level.value <= Level.FINE.value) { - pyLevel = 'traffic'; - } else if (level.value <= Level.CONFIG.value) { - pyLevel = 'debug'; - } else if (level.value <= Level.INFO.value) { - pyLevel = 'info'; - } else if (level.value <= Level.WARNING.value) { - pyLevel = 'warning'; - } else if (level.value <= Level.SEVERE.value) { - pyLevel = 'error'; - } else { - pyLevel = 'critical'; - } - command('logging', [], params: {'level': pyLevel}); + void setLogLevel(Level level) async { + final name = Levels.LEVELS + .firstWhere((e) => level.value <= e.value, orElse: () => Level.OFF) + .name + .toLowerCase(); + + await command('logging', [], params: {'level': name}); } void _send(Map data) { diff --git a/lib/desktop/state.dart b/lib/desktop/state.dart index 379d0f9f..6c3d7cd2 100755 --- a/lib/desktop/state.dart +++ b/lib/desktop/state.dart @@ -5,6 +5,7 @@ import 'package:logging/logging.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:window_manager/window_manager.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../app/state.dart'; import '../core/state.dart'; @@ -74,7 +75,7 @@ class _WindowStateNotifier extends StateNotifier @override set state(WindowState value) { - _log.config('Window state changed: $value'); + _log.debug('Window state changed: $value'); super.state = value; } @@ -104,7 +105,7 @@ class _WindowStateNotifier extends StateNotifier _idleTimer?.cancel(); break; default: - _log.fine('Window event ignored: $eventName'); + _log.traffic('Window event ignored: $eventName'); } } } diff --git a/lib/fido/views/add_fingerprint_dialog.dart b/lib/fido/views/add_fingerprint_dialog.dart index d92f13a8..f9f40977 100755 --- a/lib/fido/views/add_fingerprint_dialog.dart +++ b/lib/fido/views/add_fingerprint_dialog.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../../app/message.dart'; import '../../widgets/responsive_dialog.dart'; @@ -83,12 +84,12 @@ class _AddFingerprintDialogState extends ConsumerState // This needs a short delay to ensure the field is enabled first Timer(const Duration(milliseconds: 100), _nameFocus.requestFocus); }, error: (code) { - _log.config('Fingerprint capture error (code: $code)'); + _log.debug('Fingerprint capture error (code: $code)'); _color = _animateColor(Colors.redAccent); }); }); }, onError: (error, stacktrace) { - _log.severe('Error adding fingerprint', error, stacktrace); + _log.error('Error adding fingerprint', error, stacktrace); Navigator.of(context).pop(); showMessage(context, 'Error adding fingerprint'); }); diff --git a/lib/fido/views/reset_dialog.dart b/lib/fido/views/reset_dialog.dart index f04db6a0..5e4bcb6e 100755 --- a/lib/fido/views/reset_dialog.dart +++ b/lib/fido/views/reset_dialog.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../../app/message.dart'; import '../../core/models.dart'; @@ -93,7 +94,7 @@ class _ResetDialogState extends ConsumerState { Navigator.of(context).pop(); showMessage(context, 'FIDO application reset'); }, onError: (e) { - _log.severe('Error performing FIDO reset', e); + _log.error('Error performing FIDO reset', e); Navigator.of(context).pop(); showMessage(context, 'Error performing reset'); }); diff --git a/lib/oath/views/add_account_page.dart b/lib/oath/views/add_account_page.dart index 5d762825..b1ff91a2 100755 --- a/lib/oath/views/add_account_page.dart +++ b/lib/oath/views/add_account_page.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import '../../app/message.dart'; import '../../app/models.dart'; @@ -383,7 +384,7 @@ class _OathAddAccountPageState extends ConsumerState { Navigator.of(context).pop(); showMessage(context, 'Account added'); } catch (e) { - _log.severe('Failed to add account', e); + _log.error('Failed to add account', e); showMessage(context, 'Failed adding account'); } } else { diff --git a/lib/settings_page.dart b/lib/settings_page.dart index be812d72..d08b22c6 100755 --- a/lib/settings_page.dart +++ b/lib/settings_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:logging/logging.dart'; +import 'package:yubico_authenticator/app/logging.dart'; import 'app/state.dart'; import 'widgets/responsive_dialog.dart'; @@ -30,7 +31,7 @@ class SettingsPage extends ConsumerWidget { .toList(), onChanged: (mode) { ref.read(themeModeProvider.notifier).setThemeMode(mode!); - _log.config('Set theme mode to $mode'); + _log.debug('Set theme mode to $mode'); }, ), ],