Merge pull request #1149 from c9s/grid2/emit-error

CHORE: max: add max auth authenticated log
This commit is contained in:
Yo-An Lin 2023-04-16 21:27:53 +08:00 committed by GitHub
commit 9c53922512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,9 @@ func NewStream(key, secret string) *Stream {
stream.SetParser(max.ParseMessage) stream.SetParser(max.ParseMessage)
stream.SetDispatcher(stream.dispatchEvent) stream.SetDispatcher(stream.dispatchEvent)
stream.OnConnect(stream.handleConnect) stream.OnConnect(stream.handleConnect)
stream.OnAuthEvent(func(e max.AuthEvent) {
log.Infof("max websocket connection authenticated: %+v", e)
})
stream.OnKLineEvent(stream.handleKLineEvent) stream.OnKLineEvent(stream.handleKLineEvent)
stream.OnOrderSnapshotEvent(stream.handleOrderSnapshotEvent) stream.OnOrderSnapshotEvent(stream.handleOrderSnapshotEvent)
stream.OnOrderUpdateEvent(stream.handleOrderUpdateEvent) stream.OnOrderUpdateEvent(stream.handleOrderUpdateEvent)