Tweak log levels in providers

merge-requests/67/merge
Hank Grabowski 2024-11-26 17:12:43 -05:00
rodzic 733751038b
commit cfd3ad56ce
6 zmienionych plików z 343 dodań i 10 usunięć

Wyświetl plik

@ -29,7 +29,7 @@ class BlocksManager extends _$BlocksManager {
Future<void> blockConnection(Connection connection) async {
_logger
.finest('Attempting to block ${connection.name}: ${connection.status}');
.fine('Attempting to block ${connection.name}: ${connection.status}');
final blocks = List<Connection>.from(state.value ?? []);
await RelationshipsClient(profile)
.blockConnection(connection)

Wyświetl plik

@ -6,7 +6,7 @@ part of 'blocks_services.dart';
// RiverpodGenerator
// **************************************************************************
String _$blocksManagerHash() => r'f25be9c00b99d64558d9e066ccf031f70e172102';
String _$blocksManagerHash() => r'c866bacb4adf4f526f433d77d05a7e7309c6b6d0';
/// Copied from Dart SDK
class _SystemHash {

Wyświetl plik

@ -17,10 +17,10 @@ final _resharesLogger = Logger('ResharesForStatusProvider');
@riverpod
Future<Result<List<Connection>, 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<Result<List<Connection>, ExecError>> likesForStatus(
Future<Result<List<Connection>, 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;
}

Wyświetl plik

@ -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<AsyncValue<Result<List<Connection>, 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<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'likesForStatusProvider';
}
/// See also [likesForStatus].
class LikesForStatusProvider
extends AutoDisposeFutureProvider<Result<List<Connection>, 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<Result<List<Connection>, 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<Result<List<Connection>, 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<Result<List<Connection>, ExecError>> {
/// The parameter `profile` of this provider.
Profile get profile;
/// The parameter `statusId` of this provider.
String get statusId;
}
class _LikesForStatusProviderElement extends AutoDisposeFutureProviderElement<
Result<List<Connection>, 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<AsyncValue<Result<List<Connection>, 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<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'resharesForStatusProvider';
}
/// See also [resharesForStatus].
class ResharesForStatusProvider
extends AutoDisposeFutureProvider<Result<List<Connection>, 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<Result<List<Connection>, 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<Result<List<Connection>, 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<Result<List<Connection>, ExecError>> {
/// The parameter `profile` of this provider.
Profile get profile;
/// The parameter `statusId` of this provider.
String get statusId;
}
class _ResharesForStatusProviderElement
extends AutoDisposeFutureProviderElement<
Result<List<Connection>, 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

Wyświetl plik

@ -24,7 +24,7 @@ class TimelineEntryFilters extends _$TimelineEntryFilters {
@override
Map<String, TimelineEntryFilter> 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;
}

Wyświetl plik

@ -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<Map<String, TimelineEntryFilter>> {