Skip to content

Conversation

@anndono
Copy link
Contributor

@anndono anndono commented Dec 3, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR improves logging consistency by migrating parts of the codebase from mixed plain-text and structural logging to contextual logging.

Changes:

  • Replaced occurrences of: klog.V(n).Infof/klog.V(n).Info/klog.V(n).InfoS with logger.V(n).Info for contextual logging
  • Updated certain Info logs to Error logs where error details are present

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 3, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @anndono. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@github-actions github-actions bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Dec 3, 2025
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 3, 2025
@nilo19
Copy link
Contributor

nilo19 commented Dec 3, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 3, 2025
@nilo19 nilo19 requested a review from Copilot December 3, 2025 02:45
Copilot finished reviewing on behalf of nilo19 December 3, 2025 02:46
@nilo19
Copy link
Contributor

nilo19 commented Dec 3, 2025

Please fix the linting issue. You may use the corresponding makefile target to check linting locally. Both for main module and pkg/azclient module (there are two makefiles separatedly).

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 migrates logging from the traditional klog.V(n).Infof/Info/InfoS pattern to contextual logging using logger.V(n).Info with structured key-value pairs. The changes also convert some Info logs to Error logs where error details are present, improving logging consistency across the codebase.

Key changes:

  • Replaced klog verbosity-based logging with contextual logger.V(n).Info throughout the codebase
  • Introduced log.Background().WithName() pattern for logger initialization in functions
  • Converted formatted string messages to structured key-value logging
  • Updated certain Info logs to Error logs where errors are being logged

Reviewed changes

Copilot reviewed 49 out of 52 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/util/node/node.go Migrated PatchNodeCIDRs logging to contextual logging
pkg/util/controller/node/controller_utils.go Updated RecordNodeStatusChange logging
pkg/provider/subnet/subnet.go Converted SubnetsClient logging to structured format
pkg/provider/storage/*.go Migrated storage-related logging across multiple files
pkg/provider/securitygroup/*.go Updated security group operation logging
pkg/provider/azure_zones.go Converted zone-related logging to contextual format
pkg/provider/azure_vmssflex*.go Migrated VMSS Flex logging throughout
pkg/provider/azure_vmss*.go Updated VMSS operation logging
pkg/provider/azure_standard.go Converted availability set logging
pkg/provider/azure_loadbalancer*.go Extensive migration of load balancer logging
pkg/provider/azure_routes.go Updated route management logging
pkg/provider/azure*.go Various provider operation logging updates
pkg/nodemanager/nodemanager.go Migrated node manager logging
pkg/nodeipam/ipam/*.go Updated IPAM allocator logging
pkg/metrics/azure_metrics.go Converted metrics logging
pkg/credentialprovider/*.go Updated credential provider logging
pkg/azclient/policy/retryaftermin/*.go Migrated retry policy logging

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

@anndono anndono force-pushed the chengan/migrate-to-contextual-logging-with-verbosity branch from e60fb0a to d51eec5 Compare December 3, 2025 05:32
@nilo19
Copy link
Contributor

nilo19 commented Dec 3, 2025

/retest

1 similar comment
@nilo19
Copy link
Contributor

nilo19 commented Dec 3, 2025

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 3, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants