Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riverpod logger is printing the state twice #241

Closed
ArinFaraj opened this issue Jun 12, 2024 · 0 comments
Closed

Riverpod logger is printing the state twice #241

ArinFaraj opened this issue Jun 12, 2024 · 0 comments

Comments

@ArinFaraj
Copy link
Contributor

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): └──────────────────────────────────────────────────────────────────────────────────────────────────────────────
@Frezyx Frezyx closed this as completed in 08b9a92 Jul 18, 2024
Frezyx added a commit that referenced this issue Jul 18, 2024
fix(riverpod_logger): duplicated state logs fixes #241
XanderD99 pushed a commit to XanderD99/talker that referenced this issue Jul 24, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant