A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ksonnet/ksonnet/commit/6f2791e07bf8a71d6bdb6ede4b4977d434f69bd9 below:

Merge pull request #523 from bryanl/log-verbosity-handling · ksonnet/ksonnet@6f2791e · GitHub

@@ -30,12 +30,12 @@ import (

30 30

"github.com/ksonnet/ksonnet/metadata"

31 31

"github.com/ksonnet/ksonnet/pkg/app"

32 32

"github.com/ksonnet/ksonnet/pkg/env"

33 +

"github.com/ksonnet/ksonnet/pkg/log"

33 34

"github.com/ksonnet/ksonnet/pkg/pipeline"

34 35

"github.com/ksonnet/ksonnet/pkg/plugin"

35 36

str "github.com/ksonnet/ksonnet/pkg/util/strings"

36 37

"github.com/ksonnet/ksonnet/template"

37 38

"github.com/pkg/errors"

38 -

log "github.com/sirupsen/logrus"

39 39

"github.com/spf13/afero"

40 40

"github.com/spf13/cobra"

41 41

@@ -68,21 +68,13 @@ application configuration to remote clusters.

68 68

PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

69 69

goflag.CommandLine.Parse([]string{})

70 70

flags := cmd.Flags()

71 -

out := cmd.OutOrStderr()

72 -

log.SetOutput(out)

73 - 74 -

logFmt := &log.TextFormatter{

75 -

DisableTimestamp: true,

76 -

DisableLevelTruncation: true,

77 -

QuoteEmptyFields: true,

78 -

}

79 -

log.SetFormatter(logFmt)

80 71 81 72

verbosity, err := flags.GetCount(flagVerbose)

82 73

if err != nil {

83 74

return err

84 75

}

85 -

log.SetLevel(logLevel(verbosity))

76 + 77 +

log.Init(verbosity, cmd.OutOrStderr())

86 78 87 79

wd, err := os.Getwd()

88 80

if err != nil {

@@ -155,15 +147,6 @@ func runPlugin(p plugin.Plugin, args []string) error {

155 147

return cmd.Run()

156 148

}

157 149 158 -

func logLevel(verbosity int) log.Level {

159 -

switch verbosity {

160 -

case 0:

161 -

return log.InfoLevel

162 -

default:

163 -

return log.DebugLevel

164 -

}

165 -

}

166 - 167 150

func newExpander(fs afero.Fs, cmd *cobra.Command) (*template.Expander, error) {

168 151

flags := cmd.Flags()

169 152

spec := template.NewExpander(fs)

@@ -256,11 +239,6 @@ func newCmdObjExpander(c cmdObjExpanderConfig) *cmdObjExpander {

256 239 257 240

// Expands expands the templates.

258 241

func (te *cmdObjExpander) Expand() ([]*unstructured.Unstructured, error) {

259 -

// expander, err := te.templateExpanderFn(te.config.fs, te.config.cmd)

260 -

// if err != nil {

261 -

// return nil, errors.Wrap(err, "template expander")

262 -

// }

263 - 264 242

manager, err := metadata.Find(te.config.cwd)

265 243

if err != nil {

266 244

return nil, errors.Wrap(err, "find metadata")


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4