From cfd3ad56ce041dba3b2f071dce63d841c12880e8 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Tue, 26 Nov 2024 17:12:43 -0500 Subject: [PATCH] Tweak log levels in providers --- lib/riverpod_controllers/blocks_services.dart | 2 +- .../blocks_services.g.dart | 2 +- .../interactions_details_services.dart | 8 +- .../interactions_details_services.g.dart | 333 ++++++++++++++++++ .../timeline_entry_filter_services.dart | 4 +- .../timeline_entry_filter_services.g.dart | 4 +- 6 files changed, 343 insertions(+), 10 deletions(-) create mode 100644 lib/riverpod_controllers/interactions_details_services.g.dart diff --git a/lib/riverpod_controllers/blocks_services.dart b/lib/riverpod_controllers/blocks_services.dart index d3c88cf..dfaea70 100644 --- a/lib/riverpod_controllers/blocks_services.dart +++ b/lib/riverpod_controllers/blocks_services.dart @@ -29,7 +29,7 @@ class BlocksManager extends _$BlocksManager { Future blockConnection(Connection connection) async { _logger - .finest('Attempting to block ${connection.name}: ${connection.status}'); + .fine('Attempting to block ${connection.name}: ${connection.status}'); final blocks = List.from(state.value ?? []); await RelationshipsClient(profile) .blockConnection(connection) diff --git a/lib/riverpod_controllers/blocks_services.g.dart b/lib/riverpod_controllers/blocks_services.g.dart index 3800802..fdf5eb2 100644 --- a/lib/riverpod_controllers/blocks_services.g.dart +++ b/lib/riverpod_controllers/blocks_services.g.dart @@ -6,7 +6,7 @@ part of 'blocks_services.dart'; // RiverpodGenerator // ************************************************************************** -String _$blocksManagerHash() => r'f25be9c00b99d64558d9e066ccf031f70e172102'; +String _$blocksManagerHash() => r'c866bacb4adf4f526f433d77d05a7e7309c6b6d0'; /// Copied from Dart SDK class _SystemHash { diff --git a/lib/riverpod_controllers/interactions_details_services.dart b/lib/riverpod_controllers/interactions_details_services.dart index 49341a1..bb99527 100644 --- a/lib/riverpod_controllers/interactions_details_services.dart +++ b/lib/riverpod_controllers/interactions_details_services.dart @@ -17,10 +17,10 @@ final _resharesLogger = Logger('ResharesForStatusProvider'); @riverpod Future, ExecError>> likesForStatus( LikesForStatusRef ref, Profile profile, String statusId) async { - _likesLogger.info('Creating provider for $statusId for Profile $profile'); + _likesLogger.fine('Creating provider for $statusId for Profile $profile'); ref.cacheFor(_cacheDuration); final likesResult = await InteractionsClient(profile).getLikes(statusId); - _likesLogger.info('Values received for $statusId for Profile $profile'); + _likesLogger.fine('Values received for $statusId for Profile $profile'); return likesResult; } @@ -29,11 +29,11 @@ Future, ExecError>> likesForStatus( Future, ExecError>> resharesForStatus( ResharesForStatusRef ref, Profile profile, String statusId) async { ref.cacheFor(_cacheDuration); - _resharesLogger.info('Creating provider for $statusId for Profile $profile'); + _resharesLogger.fine('Creating provider for $statusId for Profile $profile'); final resharesResult = await InteractionsClient(profile).getReshares(statusId); - _resharesLogger.info('Values received for $statusId for Profile $profile'); + _resharesLogger.fine('Values received for $statusId for Profile $profile'); return resharesResult; } diff --git a/lib/riverpod_controllers/interactions_details_services.g.dart b/lib/riverpod_controllers/interactions_details_services.g.dart new file mode 100644 index 0000000..aa97250 --- /dev/null +++ b/lib/riverpod_controllers/interactions_details_services.g.dart @@ -0,0 +1,333 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'interactions_details_services.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$likesForStatusHash() => r'845a6114157a80c79054c4c52ccee7e797333480'; + +/// Copied from Dart SDK +class _SystemHash { + _SystemHash._(); + + static int combine(int hash, int value) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + value); + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); + return hash ^ (hash >> 6); + } + + static int finish(int hash) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); + // ignore: parameter_assignments + hash = hash ^ (hash >> 11); + return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); + } +} + +/// See also [likesForStatus]. +@ProviderFor(likesForStatus) +const likesForStatusProvider = LikesForStatusFamily(); + +/// See also [likesForStatus]. +class LikesForStatusFamily + extends Family, ExecError>>> { + /// See also [likesForStatus]. + const LikesForStatusFamily(); + + /// See also [likesForStatus]. + LikesForStatusProvider call( + Profile profile, + String statusId, + ) { + return LikesForStatusProvider( + profile, + statusId, + ); + } + + @override + LikesForStatusProvider getProviderOverride( + covariant LikesForStatusProvider provider, + ) { + return call( + provider.profile, + provider.statusId, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'likesForStatusProvider'; +} + +/// See also [likesForStatus]. +class LikesForStatusProvider + extends AutoDisposeFutureProvider, ExecError>> { + /// See also [likesForStatus]. + LikesForStatusProvider( + Profile profile, + String statusId, + ) : this._internal( + (ref) => likesForStatus( + ref as LikesForStatusRef, + profile, + statusId, + ), + from: likesForStatusProvider, + name: r'likesForStatusProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$likesForStatusHash, + dependencies: LikesForStatusFamily._dependencies, + allTransitiveDependencies: + LikesForStatusFamily._allTransitiveDependencies, + profile: profile, + statusId: statusId, + ); + + LikesForStatusProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.profile, + required this.statusId, + }) : super.internal(); + + final Profile profile; + final String statusId; + + @override + Override overrideWith( + FutureOr, ExecError>> Function( + LikesForStatusRef provider) + create, + ) { + return ProviderOverride( + origin: this, + override: LikesForStatusProvider._internal( + (ref) => create(ref as LikesForStatusRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + profile: profile, + statusId: statusId, + ), + ); + } + + @override + AutoDisposeFutureProviderElement, ExecError>> + createElement() { + return _LikesForStatusProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is LikesForStatusProvider && + other.profile == profile && + other.statusId == statusId; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, profile.hashCode); + hash = _SystemHash.combine(hash, statusId.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin LikesForStatusRef + on AutoDisposeFutureProviderRef, ExecError>> { + /// The parameter `profile` of this provider. + Profile get profile; + + /// The parameter `statusId` of this provider. + String get statusId; +} + +class _LikesForStatusProviderElement extends AutoDisposeFutureProviderElement< + Result, ExecError>> with LikesForStatusRef { + _LikesForStatusProviderElement(super.provider); + + @override + Profile get profile => (origin as LikesForStatusProvider).profile; + @override + String get statusId => (origin as LikesForStatusProvider).statusId; +} + +String _$resharesForStatusHash() => r'2058cbb1037bec18b1101108a4db3f96dfb0a6ac'; + +/// See also [resharesForStatus]. +@ProviderFor(resharesForStatus) +const resharesForStatusProvider = ResharesForStatusFamily(); + +/// See also [resharesForStatus]. +class ResharesForStatusFamily + extends Family, ExecError>>> { + /// See also [resharesForStatus]. + const ResharesForStatusFamily(); + + /// See also [resharesForStatus]. + ResharesForStatusProvider call( + Profile profile, + String statusId, + ) { + return ResharesForStatusProvider( + profile, + statusId, + ); + } + + @override + ResharesForStatusProvider getProviderOverride( + covariant ResharesForStatusProvider provider, + ) { + return call( + provider.profile, + provider.statusId, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'resharesForStatusProvider'; +} + +/// See also [resharesForStatus]. +class ResharesForStatusProvider + extends AutoDisposeFutureProvider, ExecError>> { + /// See also [resharesForStatus]. + ResharesForStatusProvider( + Profile profile, + String statusId, + ) : this._internal( + (ref) => resharesForStatus( + ref as ResharesForStatusRef, + profile, + statusId, + ), + from: resharesForStatusProvider, + name: r'resharesForStatusProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$resharesForStatusHash, + dependencies: ResharesForStatusFamily._dependencies, + allTransitiveDependencies: + ResharesForStatusFamily._allTransitiveDependencies, + profile: profile, + statusId: statusId, + ); + + ResharesForStatusProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.profile, + required this.statusId, + }) : super.internal(); + + final Profile profile; + final String statusId; + + @override + Override overrideWith( + FutureOr, ExecError>> Function( + ResharesForStatusRef provider) + create, + ) { + return ProviderOverride( + origin: this, + override: ResharesForStatusProvider._internal( + (ref) => create(ref as ResharesForStatusRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + profile: profile, + statusId: statusId, + ), + ); + } + + @override + AutoDisposeFutureProviderElement, ExecError>> + createElement() { + return _ResharesForStatusProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is ResharesForStatusProvider && + other.profile == profile && + other.statusId == statusId; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, profile.hashCode); + hash = _SystemHash.combine(hash, statusId.hashCode); + + return _SystemHash.finish(hash); + } +} + +mixin ResharesForStatusRef + on AutoDisposeFutureProviderRef, ExecError>> { + /// The parameter `profile` of this provider. + Profile get profile; + + /// The parameter `statusId` of this provider. + String get statusId; +} + +class _ResharesForStatusProviderElement + extends AutoDisposeFutureProviderElement< + Result, ExecError>> with ResharesForStatusRef { + _ResharesForStatusProviderElement(super.provider); + + @override + Profile get profile => (origin as ResharesForStatusProvider).profile; + @override + String get statusId => (origin as ResharesForStatusProvider).statusId; +} +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member diff --git a/lib/riverpod_controllers/timeline_entry_filter_services.dart b/lib/riverpod_controllers/timeline_entry_filter_services.dart index a0139bb..534e0ab 100644 --- a/lib/riverpod_controllers/timeline_entry_filter_services.dart +++ b/lib/riverpod_controllers/timeline_entry_filter_services.dart @@ -24,7 +24,7 @@ class TimelineEntryFilters extends _$TimelineEntryFilters { @override Map build(Profile profile) { - _logger.info('Building filters for $profile'); + _logger.fine('Building filters for $profile'); final appDir = ref.watch(applicationSupportDirectoryProvider); filePath = p.join(appDir.path, '${profile.id}_filters.json'); final filtersFromDisk = _load(); @@ -104,7 +104,7 @@ FilterResult checkTimelineEntry( final filters = ref.watch(timelineEntryFiltersProvider(profile)); final result = runFilters(entry, filters.values.toList()); - _checkerLogger.info( + _checkerLogger.finest( 'Checked entry ${entry.id} for profile ${profile.id} and returning ${result.toActionString()}'); return result; } diff --git a/lib/riverpod_controllers/timeline_entry_filter_services.g.dart b/lib/riverpod_controllers/timeline_entry_filter_services.g.dart index 74e5d7d..e643639 100644 --- a/lib/riverpod_controllers/timeline_entry_filter_services.g.dart +++ b/lib/riverpod_controllers/timeline_entry_filter_services.g.dart @@ -178,7 +178,7 @@ class _FilterByIdProviderElement } String _$checkTimelineEntryHash() => - r'e22ebf7104e240e65036bbe5a0e0d767b3d71294'; + r'a3e68c57bfe6f553c6c8cd169f37d2a73c71e43a'; /// See also [checkTimelineEntry]. @ProviderFor(checkTimelineEntry) @@ -325,7 +325,7 @@ class _CheckTimelineEntryProviderElement } String _$timelineEntryFiltersHash() => - r'8b779925267727cf9e25417e6c401767e6e81e80'; + r'dd386f6ecd047a1dcd8602451c7a445510b03f7d'; abstract class _$TimelineEntryFilters extends BuildlessNotifier> {