debugPrint -> Logging.instance.log

This commit is contained in:
sneurlax 2023-02-21 15:21:12 -06:00
parent a44dfe7650
commit 937c1263e7

View file

@ -1017,16 +1017,19 @@ class EpicCashWallet extends CoinServiceAPI
// Listening to server responses: // Listening to server responses:
bool isConnected = true; bool isConnected = true;
textSocketHandler.incomingMessagesStream.listen((inMsg) { textSocketHandler.incomingMessagesStream.listen((inMsg) {
debugPrint('> webSocket got text message from server: "$inMsg" ' Logging.instance.log(
'[ping: ${textSocketHandler.pingDelayMs}]'); '> webSocket got text message from server: "$inMsg" '
'[ping: ${textSocketHandler.pingDelayMs}]',
level: LogLevel.Info);
}); });
// Connecting to server: // Connecting to server:
final isTextSocketConnected = await textSocketHandler.connect(); final isTextSocketConnected = await textSocketHandler.connect();
if (!isTextSocketConnected) { if (!isTextSocketConnected) {
// ignore: avoid_print // ignore: avoid_print
debugPrint( Logging.instance.log(
'Connection to [$websocketConnectionUri] failed for some reason!'); 'Connection to [$websocketConnectionUri] failed for some reason!',
level: LogLevel.Error);
isConnected = false; isConnected = false;
} }
return isConnected; return isConnected;