Skip to content

Commit

Permalink
Remove Log Assignment to Stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
Cailyn Edwards committed Feb 16, 2023
1 parent 0fd385d commit 980b24f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions kustomize/commands/localize/localize.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ package localize

import (
"fmt"
"io"
"log"

"github.com/spf13/cobra"
"io"
lclzr "sigs.k8s.io/kustomize/api/krusty/localizer"
"sigs.k8s.io/kustomize/kyaml/errors"
"sigs.k8s.io/kustomize/kyaml/filesys"
Expand All @@ -27,7 +25,6 @@ type flags struct {

// NewCmdLocalize returns a new localize command.
func NewCmdLocalize(fs filesys.FileSystem, writer io.Writer) *cobra.Command {
log.SetOutput(writer)
var f flags
cmd := &cobra.Command{
Use: "localize [target [destination]]",
Expand Down
5 changes: 0 additions & 5 deletions kustomize/commands/localize/localize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package localize_test
import (
"bytes"
"fmt"
"log"
"path/filepath"
"testing"

Expand Down Expand Up @@ -122,10 +121,6 @@ func TestOutput(t *testing.T) {
successMsg := fmt.Sprintf(`SUCCESS: localized "%s" to directory %s
`, target.String(), target.Join("dst"))
require.Equal(t, successMsg, buffy.String())

const msg = "Check that cmd log output is hooked to buffy."
log.Print(msg)
require.Contains(t, buffy.String(), msg)
}

func TestAlpha(t *testing.T) {
Expand Down

0 comments on commit 980b24f

Please sign in to comment.