Skip to content

Commit

Permalink
(Node) Reduce logs (#2342)
Browse files Browse the repository at this point in the history
* fix: reduce logs

* fix: reduce log spamming

* fix: reduce error logs
  • Loading branch information
nick-bisonai authored Dec 23, 2024
1 parent 8bfa0b1 commit 08b79cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion node/pkg/websocketfetcher/providers/bingx/bingx.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (f *BingxFetcher) customReadFunc(ctx context.Context, conn *websocket.Conn)
var result map[string]interface{}
_, data, err := conn.Read(ctx)
if err != nil {
log.Error().Str("Player", "Bingx").Err(err).Msg("error in bingx.customReadFunc, failed to read from websocket")
log.Warn().Str("Player", "Bingx").Err(err).Msg("error in bingx.customReadFunc, failed to read from websocket")
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion node/pkg/websocketfetcher/providers/coinex/coinex.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (f *CoinexFetcher) customReadFunc(ctx context.Context, conn *websocket.Conn
var result map[string]interface{}
_, data, err := conn.Read(ctx)
if err != nil {
log.Error().Str("Player", "coinex").Err(err).Msg("error in coinex.customReadFunc, failed to read from websocket")
log.Warn().Str("Player", "coinex").Err(err).Msg("error in coinex.customReadFunc, failed to read from websocket")
return nil, err
}

Expand Down
8 changes: 4 additions & 4 deletions node/pkg/wss/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (ws *WebsocketHelper) Dial(ctx context.Context) error {
}
conn, _, err := dialFunc(ctx, ws.Endpoint, dialOption)
if err != nil {
log.Error().Err(err).Str("endpoint", ws.Endpoint).Msg("error opening websocket connection")
log.Warn().Err(err).Str("endpoint", ws.Endpoint).Msg("error opening websocket connection")
return err
}

Expand Down Expand Up @@ -88,7 +88,7 @@ func (ws *WebsocketHelper) Run(ctx context.Context, router func(context.Context,
for {
err := ws.dialAndSubscribe(ctx)
if err != nil {
log.Error().Err(err).Str("endpoint", ws.Endpoint).Msg("error dialing and subscribing to websocket")
log.Warn().Err(err).Str("endpoint", ws.Endpoint).Msg("error dialing and subscribing to websocket")
time.Sleep(time.Second)
continue
}
Expand Down Expand Up @@ -185,7 +185,7 @@ func (ws *WebsocketHelper) Read(ctx context.Context, ch chan any) error {
var t any
err := wsjson.Read(ctx, ws.Conn, &t)
if err != nil {
log.Error().Err(err).Str("endpoint", ws.Endpoint).Msg("error reading from websocket")
log.Warn().Err(err).Str("endpoint", ws.Endpoint).Msg("error reading from websocket")
return err
}
ch <- t
Expand All @@ -198,7 +198,7 @@ func (ws *WebsocketHelper) Close() error {
}
err := ws.Conn.Close(websocket.StatusNormalClosure, "")
if err != nil {
log.Error().Err(err).Str("endpoint", ws.Endpoint).Msg("error closing websocket")
log.Warn().Err(err).Str("endpoint", ws.Endpoint).Msg("error closing websocket")
return err
}
return nil
Expand Down

0 comments on commit 08b79cd

Please sign in to comment.