Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace fmt.Printf/Println with logr.logger #487

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yeahdongcn
Copy link
Contributor

@yeahdongcn yeahdongcn commented Jul 31, 2024

Closes #

📑 Description

Replace fmt.Printf/Println with logr.logger for more structured and leveled logging.

2024-07-31T18:33:05+08:00       INFO    controller-runtime.metrics      Metrics server is starting to listen    {"addr": ":8080"}
2024-07-31T18:33:05+08:00       INFO    setup   starting manager
2024-07-31T18:33:05+08:00       INFO    starting server {"path": "/metrics", "kind": "metrics", "addr": "[::]:8080"}
2024-07-31T18:33:05+08:00       INFO    Starting server {"kind": "health probe", "addr": "[::]:8081"}
2024-07-31T18:33:05+08:00       INFO    Starting EventSource    {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "source": "kind source: *v1alpha1.K8sGPT"}
2024-07-31T18:33:05+08:00       INFO    Starting Controller     {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT"}
2024-07-31T18:33:05+08:00       INFO    Starting workers        {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "worker count": 1}
2024-07-31T18:33:05+08:00       INFO    Reconciling K8sGPT      {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "K8sGPT": {"name":"k8sgpt-sample-localai","namespace":"k8sgpt-operator-system"}, "namespace": "k8sgpt-operator-system", "name": "k8sgpt-sample-localai", "reconcileID": "863bf79d-ce72-4e4e-8e01-a339bc5fb51e"}
2024-07-31T18:33:05+08:00       INFO    Finished Reconciling k8sGPT     {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "K8sGPT": {"name":"k8sgpt-sample-localai","namespace":"k8sgpt-operator-system"}, "namespace": "k8sgpt-operator-system", "name": "k8sgpt-sample-localai", "reconcileID": "863bf79d-ce72-4e4e-8e01-a339bc5fb51e"}

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Testing done:

  1. make build -> ok
  2. make test -> ok
  3. docker-buildx -> ok

@yeahdongcn yeahdongcn requested review from a team as code owners July 31, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants