From bfec634f8af2c2116ad2df490dddba40808f5fa5 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 4cd6b12e..505c542b 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/get_avatar_decorations_response.dart'; @@ -558,7 +559,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 526a12c3..a80bea5b 100644 --- a/lib/src/services/socket_controller.dart +++ b/lib/src/services/socket_controller.dart @@ -79,8 +79,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); @@ -136,7 +136,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;