mirror of
https://github.com/helm/helm.git
synced 2026-02-20 00:13:02 -05:00
Merge pull request #31469 from saimanojk1/issue-31454
Convert pkg/cmd/load_plugins.go to slog
This commit is contained in:
commit
d57fb45648
1 changed files with 4 additions and 9 deletions
|
|
@ -20,7 +20,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
|
@ -63,7 +63,7 @@ func loadCLIPlugins(baseCmd *cobra.Command, out io.Writer) {
|
|||
}
|
||||
found, err := plugin.FindPlugins(dirs, descriptor)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failed to load plugins: %s\n", err)
|
||||
slog.Error("failed to load plugins", slog.String("error", err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -217,9 +217,7 @@ func loadCompletionForPlugin(pluginCmd *cobra.Command, plug plugin.Plugin) {
|
|||
|
||||
if err != nil {
|
||||
// The file could be missing or invalid. No static completion for this plugin.
|
||||
if settings.Debug {
|
||||
log.Output(2, fmt.Sprintf("[info] %s\n", err.Error()))
|
||||
}
|
||||
slog.Debug("plugin completion file loading", slog.String("error", err.Error()))
|
||||
// Continue to setup dynamic completion.
|
||||
cmds = &pluginCommand{}
|
||||
}
|
||||
|
|
@ -238,10 +236,7 @@ func addPluginCommands(plug plugin.Plugin, baseCmd *cobra.Command, cmds *pluginC
|
|||
}
|
||||
|
||||
if len(cmds.Name) == 0 {
|
||||
// Missing name for a command
|
||||
if settings.Debug {
|
||||
log.Output(2, fmt.Sprintf("[info] sub-command name field missing for %s", baseCmd.CommandPath()))
|
||||
}
|
||||
slog.Debug("sub-command name field missing", slog.String("commandPath", baseCmd.CommandPath()))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue