diff --git a/pkg/logtrace/grpc_logger.go b/pkg/logtrace/grpc_logger.go index 28b5cdcb..d4e90fdd 100644 --- a/pkg/logtrace/grpc_logger.go +++ b/pkg/logtrace/grpc_logger.go @@ -31,14 +31,14 @@ 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 @@ -46,14 +46,14 @@ 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 diff --git a/pkg/net/grpc/client/client.go b/pkg/net/grpc/client/client.go index e1698acf..a6355d08 100644 --- a/pkg/net/grpc/client/client.go +++ b/pkg/net/grpc/client/client.go @@ -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(), @@ -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) } diff --git a/sdk/adapters/lumera/adapter.go b/sdk/adapters/lumera/adapter.go index 4bfad0e5..57c00b7e 100644 --- a/sdk/adapters/lumera/adapter.go +++ b/sdk/adapters/lumera/adapter.go @@ -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) diff --git a/sdk/adapters/supernodeservice/adapter.go b/sdk/adapters/supernodeservice/adapter.go index 3195b694..4f3067df 100644 --- a/sdk/adapters/supernodeservice/adapter.go +++ b/sdk/adapters/supernodeservice/adapter.go @@ -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++ } @@ -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, + ) } }