From 3b2afbc60da6fe00dd565bb8aa7dbf455fee0890 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 21 Oct 2023 08:01:34 +0900 Subject: [PATCH] =?UTF-8?q?print=E3=82=92log=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/misskey_dart_base.dart | 3 ++- lib/src/services/socket_controller.dart | 6 +++--- lib/src/services/streaming_service.dart | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/src/misskey_dart_base.dart b/lib/src/misskey_dart_base.dart index f7553b5a..e1975ee4 100644 --- a/lib/src/misskey_dart_base.dart +++ b/lib/src/misskey_dart_base.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:developer'; import 'package:misskey_dart/misskey_dart.dart'; import 'package:misskey_dart/src/data/ping_response.dart'; @@ -556,7 +557,7 @@ class Misskey { streamingService.connect( channel: Channel.main, onChannelEventReceived: (type, response) async { - print(response); + log(response.toString()); switch (type) { case ChannelEventType.notification: await onNotification diff --git a/lib/src/services/socket_controller.dart b/lib/src/services/socket_controller.dart index 264be2f7..c8083e7d 100644 --- a/lib/src/services/socket_controller.dart +++ b/lib/src/services/socket_controller.dart @@ -78,8 +78,8 @@ class SocketController { try { webSocketChannel.sink.add(request); } catch (e) { - print("maybe already disconnected"); - print(e); + log("maybe already disconnected"); + log(e.toString()); rethrow; } finally { onDisconnected?.call(id); @@ -135,7 +135,7 @@ class SocketController { body: body, ), ); - print("send[${body.id}]: $request}"); + log("send[${body.id}]: $request}"); webSocketChannel.sink.add(request); } } diff --git a/lib/src/services/streaming_service.dart b/lib/src/services/streaming_service.dart index aa0d7500..d4da46d2 100644 --- a/lib/src/services/streaming_service.dart +++ b/lib/src/services/streaming_service.dart @@ -181,7 +181,7 @@ class StreamingService { ]); } } catch (e) { - print(e); + log(e.toString()); } finally { subscription = null; _webSocketChannel = null;