Frezyx / talker

☎️ Advanced error handler and logger for dart and flutter apps
https://pub.dev/packages/talker_flutter
MIT License
525 stars 64 forks source link

Riverpod logger is printing the state twice #241

Closed ArinFaraj closed 4 months ago

ArinFaraj commented 5 months ago

Describe the bug Riverpod logger is printing the state twice when the settings.printStateFullData is true. It works correctly when it's false

To Reproduce Steps to reproduce the behavior:

  1. Run a riverpod project
  2. Set talker riverpod observer
  3. Change some states and you will see the state printing twice on each event

Expected behavior When the settings.printStateFullData is set to true it should keep printing the state once and instead of just showing the state object type it should show it's value as well. Example

I/flutter ( 4851): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): │ [riverpod-update] | 15:31:06 340ms | 
I/flutter ( 4851): │ appThemeProvider | AsyncNotifierProviderImpl<SettingNotifier<ThemeMode>, ThemeMode> updated
I/flutter ( 4851): │ PREVIOUS state:
I/flutter ( 4851): │ AsyncLoading<ThemeMode>()
I/flutter ( 4851): │ NEW state:
I/flutter ( 4851): │ AsyncData<ThemeMode>(value: ThemeMode.system)
I/flutter ( 4851): │ PREVIOUS state: 
I/flutter ( 4851): │ AsyncLoading<ThemeMode>()
I/flutter ( 4851): │ NEW state: 
I/flutter ( 4851): │ AsyncData<ThemeMode>(value: ThemeMode.system)
I/flutter ( 4851): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): │ [riverpod-update] | 15:31:06 341ms | 
I/flutter ( 4851): │ FutureProvider<Null> updated
I/flutter ( 4851): │ PREVIOUS state:
I/flutter ( 4851): │ AsyncLoading<Null>()
I/flutter ( 4851): │ NEW state:
I/flutter ( 4851): │ AsyncData<Null>(value: null)
I/flutter ( 4851): │ PREVIOUS state: 
I/flutter ( 4851): │ AsyncLoading<Null>()
I/flutter ( 4851): │ NEW state: 
I/flutter ( 4851): │ AsyncData<Null>(value: null)
I/flutter ( 4851): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): │ [riverpod-add] | 15:31:06 374ms | 
I/flutter ( 4851): │ Provider<ThemeData> initialized
I/flutter ( 4851): │ INITIAL state: 
I/flutter ( 4851): │ ThemeData#302d1
I/flutter ( 4851): │ INITIAL state: 
I/flutter ( 4851): │ ThemeData#302d1
I/flutter ( 4851): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): │ [riverpod-add] | 15:31:06 389ms | 
I/flutter ( 4851): │ Provider<GoRouter> initialized
I/flutter ( 4851): │ INITIAL state: 
I/flutter ( 4851): │ Instance of 'GoRouter'
I/flutter ( 4851): │ INITIAL state: 
I/flutter ( 4851): │ Instance of 'GoRouter'
I/flutter ( 4851): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 4851): │ [riverpod-add] | 15:31:06 558ms | 
I/flutter ( 4851): │ Provider<Translations> initialized
I/flutter ( 4851): │ INITIAL state: 
I/flutter ( 4851): │ Instance of 'Translations'
I/flutter ( 4851): │ INITIAL state: 
I/flutter ( 4851): │ Instance of 'Translations'
I/flutter ( 4851): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────