Improve logs

This commit is contained in:
Ming Ming 2022-09-23 18:09:43 +08:00
parent 241b1c4775
commit f0ea012056

View file

@ -199,7 +199,7 @@ class ScanAccountDirBloc
} }
final cacheFiles = await _queryOffline(ev); final cacheFiles = await _queryOffline(ev);
_log.info( _log.info(
"[_onEventQuery] Elapsed time (_queryOffline): ${stopwatch.elapsedMilliseconds}ms"); "[_onEventQuery] Elapsed time (_queryOffline): ${stopwatch.elapsedMilliseconds}ms, ${cacheFiles.length} files");
if (!hasContent) { if (!hasContent) {
// show something instantly on first load // show something instantly on first load
emit(ScanAccountDirBlocLoading( emit(ScanAccountDirBlocLoading(
@ -220,6 +220,7 @@ class ScanAccountDirBloc
return; return;
} }
if (_isFileOfInterest(ev.file)) { if (_isFileOfInterest(ev.file)) {
_log.info("[_onFileRemovedEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -245,6 +246,7 @@ class ScanAccountDirBloc
return; return;
} }
_log.info("[_onFilePropertyUpdatedEvent] Request refresh");
if (ev.hasAnyProperties([ if (ev.hasAnyProperties([
FilePropertyUpdatedEvent.propIsArchived, FilePropertyUpdatedEvent.propIsArchived,
FilePropertyUpdatedEvent.propOverrideDateTime, FilePropertyUpdatedEvent.propOverrideDateTime,
@ -267,6 +269,7 @@ class ScanAccountDirBloc
// no data in this bloc, ignore // no data in this bloc, ignore
return; return;
} }
_log.info("[_onFileTrashbinRestoredEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -279,6 +282,7 @@ class ScanAccountDirBloc
return; return;
} }
if (_isFileOfInterest(ev.file)) { if (_isFileOfInterest(ev.file)) {
_log.info("[_onFileMovedEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -292,6 +296,7 @@ class ScanAccountDirBloc
return; return;
} }
if (ev.account.compareServerIdentity(account)) { if (ev.account.compareServerIdentity(account)) {
_log.info("[_onFavoriteResyncedEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -305,6 +310,7 @@ class ScanAccountDirBloc
return; return;
} }
if (ev.key == PrefKey.accounts3) { if (ev.key == PrefKey.accounts3) {
_log.info("[_onPrefUpdatedEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -319,6 +325,7 @@ class ScanAccountDirBloc
} }
if (ev.key == PrefKey.shareFolder && if (ev.key == PrefKey.shareFolder &&
identical(ev.pref, AccountPref.of(account))) { identical(ev.pref, AccountPref.of(account))) {
_log.info("[_onAccountPrefUpdatedEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -327,6 +334,7 @@ class ScanAccountDirBloc
} }
void _onNativeFileExifUpdated(FileExifUpdatedEvent ev) { void _onNativeFileExifUpdated(FileExifUpdatedEvent ev) {
_log.info("[_onNativeFileExifUpdated] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,
@ -335,6 +343,7 @@ class ScanAccountDirBloc
void _onImageProcessorUploadSuccessEvent( void _onImageProcessorUploadSuccessEvent(
ImageProcessorUploadSuccessEvent ev) { ImageProcessorUploadSuccessEvent ev) {
_log.info("[_onImageProcessorUploadSuccessEvent] Request refresh");
_refreshThrottler.trigger( _refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3), maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10, maxPendingCount: 10,