Skip to content

Commit 978c52b

Browse files
Make Electrum connection logs less spammy (#571)
Stacktraces have little usefulness and are quite spammy.
1 parent 439c38a commit 978c52b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class ElectrumClient(
7979
listenJob = listen(socket)
8080
true
8181
} catch (ex: Throwable) {
82-
logger.warning(ex) { "electrum connection handshake failed: " }
82+
logger.warning { "electrum connection handshake failed: ${ex.message}" }
8383
val ioException = when (ex) {
8484
is TcpSocket.IOException -> ex
8585
else -> TcpSocket.IOException.Unknown(ex.message, ex)
@@ -111,7 +111,7 @@ class ElectrumClient(
111111
socket
112112
}
113113
} catch (ex: Throwable) {
114-
logger.warning(ex) { "could not connect to electrum server: " }
114+
logger.warning { "could not connect to electrum server: ${ex.message}" }
115115
val ioException = when (ex) {
116116
is TcpSocket.IOException -> ex
117117
else -> TcpSocket.IOException.ConnectionRefused(ex)
@@ -160,7 +160,7 @@ class ElectrumClient(
160160
// We use a SupervisorJob to ensure that our CoroutineExceptionHandler is used and exceptions don't propagate
161161
// to our parent scope: we simply disconnect and wait for the application to initiate a reconnection.
162162
val job = scope.launch(CoroutineName("electrum-client") + SupervisorJob() + CoroutineExceptionHandler { _, ex ->
163-
logger.warning(ex) { "electrum connection error: " }
163+
logger.warning { "electrum connection error: ${ex.message}" }
164164
socket.close()
165165
val ioException = when (ex) {
166166
is TcpSocket.IOException -> ex

0 commit comments

Comments
 (0)