Avoid using and setting a global slog
What would you like to be added?
As a Helm SDK I would like Helm to avoid using slog.Info/Debug/Warn and statements and instead use a logger I can pass in.
As a user who embeds the entire Helm CLI into my project I would like Helm to avoid relying on setting a global default logger. https://github.com/helm/helm/blob/40a9de1086bfd97f5e7a456c60221324b95e72f1/pkg/cmd/root.go#L133 Of course, I can send in my own logger, but then it will change the Helm UX, and will make flags like --color irrelevant
Why is this needed?
From an SDK perspective, unless I'm setting my global logger before certain function calls, I will miss out on pertinent logs. See https://github.com/helm/helm/pull/31717.
As a user embedding Helm, it's inconvenient to have to set a global slogger. Ideally I could pass in a logger at the CLI level and it would be propagated throughout the codebase. This would also allow SDK users to send in a logger when they need to.
Source: helm/helm