Skip to content

Conversation

@camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Aug 24, 2025

(fix): Fix inconsistent logging format

Follow up: #4968

Testing alpha update and generate revealed logs were not in the right format.

Changes:

  • Initialize consistent logging handler in alpha commands to fix level=info msg= format
  • Replace log.Fatalf with slog.Error + os.Exit(1) for proper error handling
  • Standardize log imports to use log "log/slog" across all files
  • Remove redundant command info from RunCmd logging output
  • Ensure all kubebuilder processes use the same colored INFO/WARN format

Before: level=warning msg="Using current working directory..."
After: WARN Using current working directory...

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 24, 2025
@k8s-ci-robot k8s-ci-robot requested a review from Kavinjsir August 24, 2025 09:46
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 24, 2025
@camilamacedo86 camilamacedo86 changed the title WIP (fix): log format using slog 🌱 (fix): log format using slog Aug 24, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 24, 2025
Follow up: kubernetes-sigs#4968

Testing alpha update and generate revealed logs were not in the right format.

Changes:
- Initialize consistent logging handler in alpha commands to fix level=info msg= format
- Replace log.Fatalf with slog.Error + os.Exit(1) for proper error handling
- Standardize log imports to use log "log/slog" across all files
- Remove redundant command info from RunCmd logging output
- Ensure all kubebuilder processes use the same colored INFO/WARN format

Before: level=warning msg="Using current working directory..."
After:  WARN Using current working directory...

Assisted-by: Cursor
@camilamacedo86 camilamacedo86 force-pushed the fix-logs-alpha-commands-cli branch from 8ce27dc to 8aca76b Compare August 24, 2025 09:54
@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 24, 2025
@camilamacedo86
Copy link
Member Author

Moving forward since it is a small fix

@camilamacedo86 camilamacedo86 changed the title 🌱 (fix): log format using slog 🌱 (fix): Fix inconsistent logging format ( Follow up: #4968 ) Aug 24, 2025
@k8s-ci-robot k8s-ci-robot merged commit 0186494 into kubernetes-sigs:master Aug 24, 2025
21 checks passed
@camilamacedo86 camilamacedo86 deleted the fix-logs-alpha-commands-cli branch August 24, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants