S5 icon indicating copy to clipboard operation
S5 copied to clipboard

[BUG] Overly verbose logging

Open lukehmcc opened this issue 1 year ago • 0 comments

If you run your own S5 node you'll notice that it is extremely spammy about failed wss connections like so.

flutter: [S5] [warn] [S5] WebSocketException: Connection to 'https://s5.vup.dev:0/s5/p2p#' was not upgraded to websocket
flutter: [S5] [S5] #0      _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1011:41)
#1      WebSocket.connect (dart:_http/websocket.dart:320:22)
#2      new IOWebSocketChannel.connect (package:web_socket_channel/io.dart:81:28)
#3      connect (package:web_socket_channel/src/_connect_io.dart:15:24)
#4      new WebSocketChannel.connect (package:web_socket_channel/src/channel.dart:144:16)
#5      P2PService.connectToNode.<anonymous closure> (package:lib5/src/node/service/p2p.dart:633:44)
#6      _rootRun (dart:async/zone.dart:1399:13)
#7      _CustomZone.run (dart:async/zone.dart:1301:19)
#8      _runZoned (dart:async/zone.dart:1826:10)
#9      runZonedGuarded (dart:async/zone.dart:1814:12)
#10     P2PService.connectToNode (package:lib5/src/node/service/p2p.dart:612:5)
#11     P2PService.start (package:lib5/src/node/service/p2p.dart:122:7)
#12     S5NodeBase.start (package:lib5/src/node/node.dart:64:15)
#13     S5NodeAPI.init (package:lib5/src/api/node.dart:14:16)
#14     S5.create (package:s5/src/s5_base.dart:73:15)
<asynchronous suspension>
#15     _initS5 (package:vup_chat/functions/s5.dart:33:19)
<asynchronous suspension>
#16     initS5 (package:vup_chat/functions/s5.dart:17:12)
<asynchronous suspension>
#17     MsgCore.msgInitS5 (package:vup_chat/messenger/core.dart:71:10)
<asynchronous suspension>
#18     main (package:vup_chat/main.dart:34:5)
<asynchronous suspension>

Maybe I'm wrong, but these don't feel very helpful and seriously clutter any logfile. If anything, this exception should be caught and logged more gracefully than a stack trace every single time.

lukehmcc avatar Aug 09 '24 19:08 lukehmcc