mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
Only set error filter function if not already set, which is important for callers to intercept the init messages.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user