Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Node) Reduce logs #2342

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading