Only set error filter function if not already set, which is important for callers to intercept the init messages.

This commit is contained in:
Kleissner
2021-07-06 13:37:27 +02:00
parent 96ee35ebf9
commit 27fdafd231

View File

@@ -30,7 +30,10 @@ func initFilters() {
Filters.NewPeer = func(peer *PeerInfo, connection *Connection) {}
Filters.NewPeerConnection = func(peer *PeerInfo, connection *Connection) {}
Filters.LogError = DefaultLogError
// Only set the error function if not already set before init.
if Filters.LogError == nil {
Filters.LogError = DefaultLogError
}
}
// DefaultLogError is the default error logging function