From 738508814493111182dfc215bd005556ce1fdc85 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Tue, 9 Apr 2024 21:44:01 +0600 Subject: [PATCH] chore: remove print statements --- lib/provider/connect/connect.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/provider/connect/connect.dart b/lib/provider/connect/connect.dart index 65daaf55..6360c750 100644 --- a/lib/provider/connect/connect.dart +++ b/lib/provider/connect/connect.dart @@ -4,6 +4,7 @@ import 'package:catcher_2/catcher_2.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:spotify/spotify.dart'; import 'package:spotube/models/connect/connect.dart'; +import 'package:spotube/models/logger.dart'; import 'package:spotube/provider/connect/clients.dart'; import 'package:spotube/provider/proxy_playlist/proxy_playlist.dart'; import 'package:spotube/services/audio_player/loop_mode.dart'; @@ -38,19 +39,21 @@ final volumeProvider = StateProvider( (ref) => 1.0, ); +final logger = getLogger('ConnectNotifier'); + class ConnectNotifier extends AsyncNotifier { @override build() async { try { final connectClients = ref.watch(connectClientsProvider); - print('Building ConnectNotifier'); if (connectClients.asData?.value.resolvedService == null) return null; final service = connectClients.asData!.value.resolvedService!; - print( - 'Connecting to ${service.name}: ws://${service.host}:${service.port}/ws'); + logger.t( + '♾️ Connecting to ${service.name}: ws://${service.host}:${service.port}/ws', + ); final channel = WebSocketChannel.connect( Uri.parse('ws://${service.host}:${service.port}/ws'), @@ -58,8 +61,9 @@ class ConnectNotifier extends AsyncNotifier { await channel.ready; - print( - 'Connected to ${service.name}: ws://${service.host}:${service.port}/ws'); + logger.t( + '✅ Connected to ${service.name}: ws://${service.host}:${service.port}/ws', + ); final subscription = channel.stream.listen( (message) {