Tweaks to logging levels

main
Hank Grabowski 2023-11-27 13:16:11 -06:00
rodzic 338547203d
commit 12233c4320
14 zmienionych plików z 33 dodań i 31 usunięć

Wyświetl plik

@ -57,7 +57,7 @@ class _MediaKitAvControlState extends State<MediaKitAvControl> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finer('Building MediaKit Control for ${widget.videoUrl}'); _logger.finest('Building MediaKit Control for ${widget.videoUrl}');
if (controller == null) { if (controller == null) {
return Container( return Container(
width: widget.width, width: widget.width,

Wyświetl plik

@ -51,14 +51,14 @@ class _InteractionsBarControlState extends State<InteractionsBarControl> {
isProcessing = true; isProcessing = true;
}); });
final newState = !isFavorited; final newState = !isFavorited;
_logger.finest('Trying to toggle favorite from $isFavorited to $newState'); _logger.fine('Trying to toggle favorite from $isFavorited to $newState');
final result = await getIt<ActiveProfileSelector<TimelineManager>>() final result = await getIt<ActiveProfileSelector<TimelineManager>>()
.activeEntry .activeEntry
.andThenAsync( .andThenAsync(
(tm) async => await tm.toggleFavorited(widget.entry.id, newState)); (tm) async => await tm.toggleFavorited(widget.entry.id, newState));
result.match(onSuccess: (update) { result.match(onSuccess: (update) {
setState(() { setState(() {
_logger.finest( _logger.fine(
'Success toggling! $isFavorited -> ${update.entry.isFavorited}'); 'Success toggling! $isFavorited -> ${update.entry.isFavorited}');
}); });
}, onError: (error) { }, onError: (error) {
@ -93,14 +93,14 @@ class _InteractionsBarControlState extends State<InteractionsBarControl> {
} }
final id = widget.entry.id; final id = widget.entry.id;
_logger.finest('Trying to reshare $id'); _logger.fine('Trying to reshare $id');
final result = await getIt<ActiveProfileSelector<TimelineManager>>() final result = await getIt<ActiveProfileSelector<TimelineManager>>()
.activeEntry .activeEntry
.andThenAsync((tm) async => await tm.resharePost(id)); .andThenAsync((tm) async => await tm.resharePost(id));
result.match(onSuccess: (update) { result.match(onSuccess: (update) {
setState(() { setState(() {
_logger.finest('Success resharing post by ${widget.entry.author}'); _logger.fine('Success resharing post by ${widget.entry.author}');
}); });
}, onError: (error) { }, onError: (error) {
buildSnackbar(context, 'Error resharing post by ${widget.entry.author}'); buildSnackbar(context, 'Error resharing post by ${widget.entry.author}');
@ -122,13 +122,13 @@ class _InteractionsBarControlState extends State<InteractionsBarControl> {
isProcessing = true; isProcessing = true;
}); });
final id = widget.entry.id; final id = widget.entry.id;
_logger.finest('Trying to un-reshare $id'); _logger.fine('Trying to un-reshare $id');
final result = await getIt<ActiveProfileSelector<TimelineManager>>() final result = await getIt<ActiveProfileSelector<TimelineManager>>()
.activeEntry .activeEntry
.andThenAsync((tm) async => await tm.unResharePost(id)); .andThenAsync((tm) async => await tm.unResharePost(id));
result.match(onSuccess: (update) { result.match(onSuccess: (update) {
setState(() { setState(() {
_logger.finest('Success un-resharing post by ${widget.entry.author}'); _logger.fine('Success un-resharing post by ${widget.entry.author}');
}); });
}, onError: (error) { }, onError: (error) {
buildSnackbar( buildSnackbar(

Wyświetl plik

@ -74,7 +74,7 @@ class _PostControlState extends State<PostControl> {
final int scrollToIndex = _scrollToIndexCalc(items); final int scrollToIndex = _scrollToIndexCalc(items);
// TODO Figure out why doesn't scroll to correct position on loading // TODO Figure out why doesn't scroll to correct position on loading
_logger.finer('Building view with initial position at $scrollToIndex'); _logger.finest('Building view with initial position at $scrollToIndex');
return ScrollablePositionedList.builder( return ScrollablePositionedList.builder(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),

Wyświetl plik

@ -817,6 +817,8 @@ class StatusesClient extends FriendicaClient {
...descendants ...descendants
.map((d) => TimelineEntryMastodonExtensions.fromJson(d)) .map((d) => TimelineEntryMastodonExtensions.fromJson(d))
]; ];
_logger.finer(() =>
'Got status $id with full context which returned ${ancestors.length} ancestors and ${descendants.length} descendants');
return items; return items;
} else { } else {
return [TimelineEntryMastodonExtensions.fromJson(json)]; return [TimelineEntryMastodonExtensions.fromJson(json)];

Wyświetl plik

@ -84,7 +84,7 @@ class _EditorScreenState extends State<EditorScreen> {
parentEntry = entry; parentEntry = entry;
visibility = entry.visibility; visibility = entry.visibility;
}, onError: (error) { }, onError: (error) {
_logger.finest('Error trying to get parent entry: $error'); _logger.severe('Error trying to get parent entry: $error');
}); });
} }
@ -96,13 +96,13 @@ class _EditorScreenState extends State<EditorScreen> {
} }
void restoreStatusData() async { void restoreStatusData() async {
_logger.fine('Attempting to load status for editing'); _logger.finer('Attempting to load status for editing');
loaded = false; loaded = false;
final result = await getIt<ActiveProfileSelector<TimelineManager>>() final result = await getIt<ActiveProfileSelector<TimelineManager>>()
.activeEntry .activeEntry
.andThenAsync((manager) async => manager.getEntryById(widget.id)); .andThenAsync((manager) async => manager.getEntryById(widget.id));
result.match(onSuccess: (entry) { result.match(onSuccess: (entry) {
_logger.fine('Loading status ${widget.id} information into fields'); _logger.finer('Loading status ${widget.id} information into fields');
contentController.text = htmlToSimpleText(entry.body); contentController.text = htmlToSimpleText(entry.body);
spoilerController.text = entry.spoilerText; spoilerController.text = entry.spoilerText;
existingMediaItems existingMediaItems
@ -227,7 +227,7 @@ class _EditorScreenState extends State<EditorScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finest('Build editor $isComment $parentEntry'); _logger.finer('Build editor $isComment $parentEntry');
final manager = context final manager = context
.read<ActiveProfileSelector<TimelineManager>>() .read<ActiveProfileSelector<TimelineManager>>()
.activeEntry .activeEntry

Wyświetl plik

@ -67,7 +67,7 @@ class _FilterEditorScreenState extends State<FilterEditorScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finer('Build for filter ${widget.id}'); _logger.finest('Build for filter ${widget.id}');
final fieldWidth = MediaQuery.of(context).size.width * 0.8; final fieldWidth = MediaQuery.of(context).size.width * 0.8;
final service = context final service = context
.watch<ActiveProfileSelector<TimelineEntryFilterService>>() .watch<ActiveProfileSelector<TimelineEntryFilterService>>()

Wyświetl plik

@ -84,7 +84,7 @@ class GalleryBrowsersScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finest('Building'); _logger.finer('Building');
final service = context final service = context
.watch<ActiveProfileSelector<GalleryService>>() .watch<ActiveProfileSelector<GalleryService>>()
.activeEntry .activeEntry

Wyświetl plik

@ -24,7 +24,7 @@ class GalleryScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finest('Building $galleryName'); _logger.finer('Building $galleryName');
final nss = getIt<NetworkStatusService>(); final nss = getIt<NetworkStatusService>();
return Scaffold( return Scaffold(
appBar: StandardAppBar.build(context, galleryName, actions: [ appBar: StandardAppBar.build(context, galleryName, actions: [
@ -59,7 +59,7 @@ class _GalleryScreenBody extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finest('Building'); _logger.finer('Building');
final service = context final service = context
.watch<ActiveProfileSelector<GalleryService>>() .watch<ActiveProfileSelector<GalleryService>>()
.activeEntry .activeEntry

Wyświetl plik

@ -29,7 +29,7 @@ class _HomeScreenState extends State<HomeScreen> {
TimelineIdentifiers currentTimeline = TimelineIdentifiers.home(); TimelineIdentifiers currentTimeline = TimelineIdentifiers.home();
void updateTimeline(TimelineManager manager) { void updateTimeline(TimelineManager manager) {
_logger.finest('Updating timeline: $currentTimeline'); _logger.finer('Updating timeline: $currentTimeline');
Future.delayed(const Duration(milliseconds: 100), () async { Future.delayed(const Duration(milliseconds: 100), () async {
await manager.updateTimeline( await manager.updateTimeline(
currentTimeline, TimelineRefreshType.refresh); currentTimeline, TimelineRefreshType.refresh);

Wyświetl plik

@ -25,7 +25,7 @@ class NotificationsScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.finest('Building'); _logger.finer('Building');
final nss = getIt<NetworkStatusService>(); final nss = getIt<NetworkStatusService>();
final managerResult = context final managerResult = context
.watch<ActiveProfileSelector<NotificationsManager>>() .watch<ActiveProfileSelector<NotificationsManager>>()

Wyświetl plik

@ -101,7 +101,7 @@ class _SearchScreenState extends State<SearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_logger.info('Build'); _logger.finer('Build');
final nss = getIt<NetworkStatusService>(); final nss = getIt<NetworkStatusService>();
final profileService = context.watch<AccountsService>(); final profileService = context.watch<AccountsService>();
final profile = profileService.currentProfile; final profile = profileService.currentProfile;
@ -205,7 +205,7 @@ class _SearchScreenState extends State<SearchScreen> {
} }
Widget buildResultBody(Profile profile) { Widget buildResultBody(Profile profile) {
_logger.fine('Building search result body with: $searchResult'); _logger.finer('Building search result body with: $searchResult');
switch (searchType) { switch (searchType) {
case SearchTypes.hashTag: case SearchTypes.hashTag:
return buildHashtagResultWidget(profile); return buildHashtagResultWidget(profile);

Wyświetl plik

@ -51,7 +51,7 @@ class BlocksManager extends ChangeNotifier {
); );
}).match( }).match(
onSuccess: (blockedUser) { onSuccess: (blockedUser) {
_logger.finest( _logger.fine(
'Successfully blocked ${blockedUser.name}: ${blockedUser.status}'); 'Successfully blocked ${blockedUser.name}: ${blockedUser.status}');
final existingIndex = _blocks.indexOf(connection); final existingIndex = _blocks.indexOf(connection);
if (existingIndex < 0) { if (existingIndex < 0) {
@ -71,8 +71,8 @@ class BlocksManager extends ChangeNotifier {
} }
Future<void> unblockConnection(Connection connection) async { Future<void> unblockConnection(Connection connection) async {
_logger.finest( _logger
'Attempting to unblock ${connection.name}: ${connection.status}'); .fine('Attempting to unblock ${connection.name}: ${connection.status}');
await RelationshipsClient(profile) await RelationshipsClient(profile)
.unblockConnection(connection) .unblockConnection(connection)
.withResult((blockedUser) { .withResult((blockedUser) {
@ -83,7 +83,7 @@ class BlocksManager extends ChangeNotifier {
); );
}).match( }).match(
onSuccess: (unblockedUser) { onSuccess: (unblockedUser) {
_logger.finest( _logger.fine(
'Successfully unblocked ${unblockedUser.name}: ${unblockedUser.status}'); 'Successfully unblocked ${unblockedUser.name}: ${unblockedUser.status}');
final existingIndex = _blocks.indexOf(connection); final existingIndex = _blocks.indexOf(connection);
if (existingIndex >= 0) { if (existingIndex >= 0) {

Wyświetl plik

@ -53,7 +53,7 @@ class TimelineManager extends ChangeNotifier {
} }
Future<void> _refreshCircleData() async { Future<void> _refreshCircleData() async {
_logger.finest('Refreshing member circle data '); _logger.finer('Refreshing member circle data ');
await CirclesClient(profile).getCircles().match( await CirclesClient(profile).getCircles().match(
onSuccess: (circles) { onSuccess: (circles) {
circlesRepo.addAllCircles(circles); circlesRepo.addAllCircles(circles);
@ -217,10 +217,10 @@ class TimelineManager extends ChangeNotifier {
FutureResult<EntryTreeItem, ExecError> toggleFavorited( FutureResult<EntryTreeItem, ExecError> toggleFavorited(
String id, bool newStatus) async { String id, bool newStatus) async {
_logger.finest('Attempting toggling favorite $id to $newStatus'); _logger.finer('Attempting toggling favorite $id to $newStatus');
final result = await entryManagerService.toggleFavorited(id, newStatus); final result = await entryManagerService.toggleFavorited(id, newStatus);
if (result.isFailure) { if (result.isFailure) {
_logger.finest('Error toggling favorite $id: ${result.error}'); _logger.info('Error toggling favorite $id: ${result.error}');
return result; return result;
} }

Wyświetl plik

@ -17,7 +17,7 @@ FutureResult<PagedResponse<String>, ExecError> getUrl(
Map<String, String>? headers, Map<String, String>? headers,
Duration? timeout, Duration? timeout,
}) async { }) async {
_logger.finer('GET: $url'); _logger.fine('GET: $url');
final requestHeaders = headers ?? {}; final requestHeaders = headers ?? {};
if (usePhpDebugging) { if (usePhpDebugging) {
requestHeaders['Cookie'] = 'XDEBUG_SESSION=PHPSTORM;path=/'; requestHeaders['Cookie'] = 'XDEBUG_SESSION=PHPSTORM;path=/';
@ -54,7 +54,7 @@ FutureResult<String, ExecError> postUrl(
Map<String, String>? headers, Map<String, String>? headers,
Duration? timeout, Duration? timeout,
}) async { }) async {
_logger.finer('POST: $url \n Body: $body'); _logger.fine('POST: $url \n Body: $body');
final requestHeaders = headers ?? {}; final requestHeaders = headers ?? {};
if (usePhpDebugging) { if (usePhpDebugging) {
requestHeaders['Cookie'] = 'XDEBUG_SESSION=PHPSTORM;path=/'; requestHeaders['Cookie'] = 'XDEBUG_SESSION=PHPSTORM;path=/';
@ -88,7 +88,7 @@ FutureResult<String, ExecError> putUrl(
Map<String, dynamic> body, { Map<String, dynamic> body, {
Map<String, String>? headers, Map<String, String>? headers,
}) async { }) async {
_logger.finer('PUT: $url \n Body: $body'); _logger.fine('PUT: $url \n Body: $body');
try { try {
final request = http.put( final request = http.put(
url, url,
@ -118,7 +118,7 @@ FutureResult<String, ExecError> deleteUrl(
Map<String, dynamic> body, { Map<String, dynamic> body, {
Map<String, String>? headers, Map<String, String>? headers,
}) async { }) async {
_logger.finer('DELETE: $url'); _logger.fine('DELETE: $url');
try { try {
final request = http.delete( final request = http.delete(
url, url,