From 6feb1570c48a7bfd8546e1520e41d3f932ddffb1 Mon Sep 17 00:00:00 2001 From: Chaphasilor Date: Wed, 11 Dec 2024 20:58:04 +0100 Subject: [PATCH] logging improvements --- lib/components/global_snackbar.dart | 2 +- lib/services/queue_service.dart | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/components/global_snackbar.dart b/lib/components/global_snackbar.dart index bcd2bce48..6758d7d2d 100644 --- a/lib/components/global_snackbar.dart +++ b/lib/components/global_snackbar.dart @@ -86,7 +86,7 @@ class GlobalSnackbar { /// Show an unlocalized error message to the user static void error(dynamic event) => _enqueue(() => _error(event)); static void _error(dynamic event) { - _logger.warning("Displaying error: $event"); + _logger.warning("Displaying error: $event", event); if (event is Error && event.stackTrace != null) { _logger.warning(event.stackTrace); } diff --git a/lib/services/queue_service.dart b/lib/services/queue_service.dart index 48c9d09a8..4613360d2 100644 --- a/lib/services/queue_service.dart +++ b/lib/services/queue_service.dart @@ -457,8 +457,12 @@ class QueueService { source: source, order: order, initialIndex: startingIndex); + _queueServiceLogger.info( + "Started playing '${GlobalSnackbar.materialAppScaffoldKey.currentContext != null ? source.name.getLocalized(GlobalSnackbar.materialAppScaffoldKey.currentContext!) : source.name.type}' (${source.type}) in order $order from index $startingIndex"); _queueServiceLogger - .info("Started playing '${source.name}' (${source.type})"); + .info("Items for queue: ${items.map((e) => e.name).join(", ")}"); + _queueServiceLogger + .info("Items for queue: ${items.map((e) => e.name).join(", ")}"); } /// Replaces the queue with the given list of items. If startAtIndex is specified, Any items below it