Skip to content
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
16 changes: 8 additions & 8 deletions pkg/logtrace/grpc_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,29 @@ func (g *grpcLogger) Infoln(args ...any) {
g.Info(args...)
}

// Warning logs at warn level
// Warning logs at debug level to avoid noisy internal gRPC chatter
func (g *grpcLogger) Warning(args ...any) {
Warn(context.Background(), fmt.Sprint(args...), Fields{"module": "grpc"})
Debug(context.Background(), fmt.Sprint(args...), Fields{"module": "grpc"})
}

// Warningf logs at warn level with format
// Warningf logs at debug level with format to avoid noisy internal gRPC chatter
func (g *grpcLogger) Warningf(format string, args ...any) {
Warn(context.Background(), fmt.Sprintf(format, args...), Fields{"module": "grpc"})
Debug(context.Background(), fmt.Sprintf(format, args...), Fields{"module": "grpc"})
}

// Warningln logs at warn level with newline
func (g *grpcLogger) Warningln(args ...any) {
g.Warning(args...)
}

// Error logs at error level
// Error logs at debug level to avoid noisy internal gRPC chatter
func (g *grpcLogger) Error(args ...any) {
Error(context.Background(), fmt.Sprint(args...), Fields{"module": "grpc"})
Debug(context.Background(), fmt.Sprint(args...), Fields{"module": "grpc"})
}

// Errorf logs at error level with format
// Errorf logs at debug level with format to avoid noisy internal gRPC chatter
func (g *grpcLogger) Errorf(format string, args ...any) {
Error(context.Background(), fmt.Sprintf(format, args...), Fields{"module": "grpc"})
Debug(context.Background(), fmt.Sprintf(format, args...), Fields{"module": "grpc"})
}

// Errorln logs at error level with newline
Expand Down
12 changes: 8 additions & 4 deletions pkg/net/grpc/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,20 @@ var waitForConnection = func(ctx context.Context, conn ClientConn, timeout time.
return nil

case connectivity.Shutdown:
logtrace.Error(timeoutCtx, "gRPC connection is SHUTDOWN", nil)
// Demote to debug to avoid noisy connection logs at error level.
logtrace.Debug(timeoutCtx, "gRPC connection is SHUTDOWN", nil)
return fmt.Errorf("grpc connection is shutdown")

case connectivity.TransientFailure:
logtrace.Error(timeoutCtx, "gRPC connection in TRANSIENT_FAILURE", nil)
// Demote to debug so transient failures during discovery do not flood error logs.
logtrace.Debug(timeoutCtx, "gRPC connection in TRANSIENT_FAILURE", nil)
return fmt.Errorf("grpc connection is in transient failure")

default:
// Idle / Connecting – wait for state change
if !conn.WaitForStateChange(timeoutCtx, state) {
logtrace.Error(timeoutCtx, "Timeout waiting for gRPC connection state change",
// Demote timeout log to debug; callers still receive an error.
logtrace.Debug(timeoutCtx, "Timeout waiting for gRPC connection state change",
logtrace.Fields{
"last_state": state.String(),
"timeout": timeout.String(),
Expand Down Expand Up @@ -299,7 +302,8 @@ func (ch *defaultConnectionHandler) attemptConnection(ctx context.Context, targe
// Wait for connection to be ready
if err := waitForConnection(ctx, gclient, opts.ConnWaitTime); err != nil {
gclient.Close()
logtrace.Error(ctx, "Connection failed", logtrace.Fields{"target": target, "error": err})
// Demote connection failures during preflight/validation to debug-level logs.
logtrace.Debug(ctx, "Connection failed", logtrace.Fields{"target": target, "error": err})

return nil, fmt.Errorf("connection failed: %w", err)
}
Expand Down
5 changes: 4 additions & 1 deletion sdk/adapters/lumera/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ func (a *Adapter) VerifySignature(ctx context.Context, accountAddr string, data,

err := a.client.Auth().Verify(ctx, accountAddr, data, signature)
if err != nil {
a.logger.Error(ctx, "Signature verification failed", "accountAddr", accountAddr, "error", err)
// Demote per-attempt failures to debug; higher-level helpers
// (e.g. cascadekit.VerifyStringRawOrADR36 + task.Manager.validateSignature)
// will emit a single error if all strategies fail.
a.logger.Debug(ctx, "Signature verification failed", "accountAddr", accountAddr, "error", err)
return fmt.Errorf("signature verification failed: %w", err)
}
a.logger.Debug(ctx, "Signature verified successfully", "accountAddr", accountAddr)
Expand Down
14 changes: 8 additions & 6 deletions sdk/adapters/supernodeservice/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ func (a *cascadeAdapter) CascadeSupernodeRegister(ctx context.Context, in *Casca
bytesRead += int64(n)
progress := float64(bytesRead) / float64(totalBytes) * 100

// Print upload progress directly to stdout
fmt.Printf("Upload progress: task_id=%s action_id=%s chunk_index=%d chunk_size=%d progress=%.1f%% bytes=%d/%d\n",
in.TaskId, in.ActionID, chunkIndex, n, progress, bytesRead, totalBytes)
a.logger.Info(ctx, "Upload progress", "taskID", in.TaskId, "actionID", in.ActionID, "chunkIndex", chunkIndex, "chunkSize", n, "progress", progress, "bytesRead", bytesRead, "totalBytes", totalBytes)

chunkIndex++
}
Expand Down Expand Up @@ -480,9 +478,13 @@ func (a *cascadeAdapter) CascadeSupernodeDownload(

a.logger.Debug(ctx, "received chunk", "chunk_index", chunkIndex, "chunk_size", len(data), "bytes_written", bytesWritten)

// Print download progress directly to stdout (similar to upload progress)
fmt.Printf("Download progress: action_id=%s chunk_index=%d chunk_size=%d bytes=%d\n",
in.ActionID, chunkIndex, len(data), bytesWritten)
// Emit download progress via logger instead of stdout
a.logger.Info(ctx, "Download progress",
"actionID", in.ActionID,
"chunkIndex", chunkIndex,
"chunkSize", len(data),
"bytesWritten", bytesWritten,
)
}
}

Expand Down