Merge branch 'master' of github.com:dfuse-io/solana-go
This commit is contained in:
commit
ff602fdde9
|
@ -15,13 +15,11 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dfuse-io/logging"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var traceEnabled = os.Getenv("TRACE") == "true"
|
||||
var traceEnabled = logging.IsTraceEnabled("solana-go", "github.com/dfuse-io/solana-go/rpc")
|
||||
var zlog *zap.Logger
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -89,11 +89,12 @@ func (c *Client) handleMessage(message []byte) {
|
|||
func (c *Client) handleNewSubscriptionMessage(requestID, subID uint64) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
zlog.Info("received new subscription message",
|
||||
zap.Uint64("message_id", requestID),
|
||||
zap.Uint64("subscription_id", subID),
|
||||
)
|
||||
if traceEnabled {
|
||||
zlog.Debug("received new subscription message",
|
||||
zap.Uint64("message_id", requestID),
|
||||
zap.Uint64("subscription_id", subID),
|
||||
)
|
||||
}
|
||||
callBack, found := c.subscriptionByRequestID[requestID]
|
||||
if !found {
|
||||
zlog.Error("cannot find websocket message handler for a new stream.... this should not happen",
|
||||
|
@ -107,9 +108,11 @@ func (c *Client) handleNewSubscriptionMessage(requestID, subID uint64) {
|
|||
}
|
||||
|
||||
func (c *Client) handleSubscriptionMessage(subID uint64, message []byte) {
|
||||
zlog.Debug("received subscription message",
|
||||
zap.Uint64("subscription_id", subID),
|
||||
)
|
||||
if traceEnabled {
|
||||
zlog.Debug("received subscription message",
|
||||
zap.Uint64("subscription_id", subID),
|
||||
)
|
||||
}
|
||||
|
||||
c.lock.RLock()
|
||||
sub, found := c.subscriptionByWSSubID[subID]
|
||||
|
|
|
@ -15,14 +15,12 @@
|
|||
package ws
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dfuse-io/logging"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var traceEnabled = os.Getenv("TRACE") == "true"
|
||||
var zlog *zap.Logger
|
||||
var traceEnabled = logging.IsTraceEnabled("solana-go", "github.com/dfuse-io/solana-go/rpc/ws")
|
||||
|
||||
func init() {
|
||||
logging.Register("github.com/dfuse-io/solana-go/rpc/ws", &zlog)
|
||||
|
|
|
@ -15,14 +15,12 @@
|
|||
package serum
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dfuse-io/logging"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var traceEnabled = os.Getenv("TRACE") != ""
|
||||
var zlog = zap.NewNop()
|
||||
var traceEnabled = logging.IsTraceEnabled("solana-go", "github.com/dfuse-io/solana-go/serum")
|
||||
|
||||
func init() {
|
||||
logging.Register("github.com/dfuse-io/solana-go/serum", &zlog)
|
||||
|
|
|
@ -15,13 +15,11 @@
|
|||
package system
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dfuse-io/logging"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var traceEnabled = os.Getenv("TRACE") != ""
|
||||
var traceEnabled = logging.IsTraceEnabled("solana-go", "github.com/dfuse-io/solana-go/system")
|
||||
var zlog = zap.NewNop()
|
||||
|
||||
func init() {
|
||||
|
|
Loading…
Reference in New Issue