Skip to content

refactor: Use IOStreams for command output instead of os.Stdout and log#372

Open
kaizakin wants to merge 1 commit intoshipwright-io:mainfrom
kaizakin:feat/newlogger
Open

refactor: Use IOStreams for command output instead of os.Stdout and log#372
kaizakin wants to merge 1 commit intoshipwright-io:mainfrom
kaizakin:feat/newlogger

Conversation

@kaizakin
Copy link

@kaizakin kaizakin commented Feb 23, 2026

Changes

Fixes #90

The original issue was about inconsistent user facing logging.
Turns out 95% of the codebase is already following the best practice as the same as kubectl.

Following @IrvingMg's suggestion,
I've updated some inconsistencies to follow the same structure as the rest of the commands.

/kind feature

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Update user facing logs to follow the same consistent pattern

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note labels Feb 23, 2026
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 23, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 23, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign qu1queee for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 2, 2026
@kaizakin kaizakin marked this pull request as ready for review March 2, 2026 12:58
Copilot AI review requested due to automatic review settings March 2, 2026 12:58
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2026
@openshift-ci openshift-ci bot requested review from adambkaplan and rxinui March 2, 2026 12:58
@openshift-ci openshift-ci bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed release-note labels Mar 2, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes user-facing CLI output by routing it through Kubernetes IOStreams (instead of writing directly to os.Stdout / fmt.Printf / log.Printf), aligning subcommands with the CLI’s existing stream-injection pattern.

Changes:

  • Update version subcommand to accept IOStreams and write to ioStreams.Out.
  • Switch multiple list subcommands’ tabwriter output from os.Stdout to io.Out.
  • Replace log.Printf/os.Stdout output in build upload with fmt.Fprintf(ioStreams.Out, ...) and thread streams through helpers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/shp/cmd/version/version.go Accepts IOStreams and writes version output to ioStreams.Out.
pkg/shp/cmd/root.go Passes ioStreams into the version command constructor.
pkg/shp/cmd/clusterbuildstrategy/list.go Writes tabular list output to io.Out instead of os.Stdout.
pkg/shp/cmd/buildstrategy/list.go Writes tabular list output to io.Out instead of os.Stdout.
pkg/shp/cmd/buildrun/list.go Writes tabular list output to io.Out instead of os.Stdout.
pkg/shp/cmd/build/upload.go Uses IOStreams for user-facing progress/info output during buildrun creation and streaming.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kaizakin kaizakin changed the title Introduce New logger for centralized loging refactor: Use IOStreams for command output instead of os.Stdout and log Mar 2, 2026
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 2, 2026
@openshift-ci openshift-ci bot added release-note and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Centralized Logging

2 participants