Skip to content

Conversation

rvarun11
Copy link
Contributor

@rvarun11 rvarun11 commented Aug 18, 2025

Closes #383

Based on the feedback received in #1362, this PR:

  • Switches from slog to zap's global SugaredLogger
  • Maintains structured/unstructured log switching via UNSTRUCTURED_LOGS env var
  • Preserves debug flag integration for log level control
  • Uses go-logr/zapr for NewLogr() Kubernetes logr.Logger compatibility

It also:

  • Adds *w functions (Debugw, Infow, etc.) for structured key-value logging
  • Adds DPanic and Fatal log levels with corresponding *f/*w variants

Optionally, we can consider updating the logger.Initialize() to init().

@rvarun11 rvarun11 force-pushed the feat-383-2 branch 5 times, most recently from 18da781 to 3873e01 Compare August 20, 2025 18:47
Copy link
Member

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

hey, @rvarun11, thanks for addressing the feedback, really appreciate it 🙌

Left a few small suggestions, but other than that it's ready to be merged 🚀

rvarun11 and others added 5 commits August 21, 2025 08:45
* Switch from slog to uber-go/zap SugaredLogger for better performance
* Add *w functions (Debugw, Infow, etc.) for structured key-value logging
* Add DPanic and Fatal log levels with corresponding *f/*w variants
* Maintain structured/unstructured log switching via UNSTRUCTURED_LOGS
* Preserve debug flag integration for log level control
* Use go-logr/zapr for NewLogr() Kubernetes logr.Logger compatibility
Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
Copy link
Member

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

@rvarun11 - Much appreciated! 🙌

@rdimitrov rdimitrov merged commit 578e516 into stacklok:main Aug 21, 2025
15 checks passed
@rvarun11
Copy link
Contributor Author

Thanks @rdimitrov! Will be monitoring now just to make sure everything is working as expected and just in case anything comes up, please feel free to ping me on Discord.

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.

Replace internal logger with zap library
2 participants