feat(kube): use env variable to control kube logging

Removes command line flags and adds the environment variable
`KUBE_LOG_LEVEL`
pull/789/head
Adam Reese 9 years ago
parent 4bb596d187
commit 0f5c2951a2

@ -2,7 +2,6 @@ package main
import (
"errors"
"flag"
"fmt"
"os"
"strings"
@ -62,7 +61,6 @@ func init() {
p.StringVar(&helmHome, "home", home, "location of your Helm config. Overrides $HELM_HOME.")
p.StringVar(&tillerHost, "host", thost, "address of tiller. Overrides $HELM_HOST.")
p.BoolVarP(&flagDebug, "debug", "", false, "enable verbose output")
p.AddGoFlagSet(flag.CommandLine)
}
func main() {

@ -0,0 +1,14 @@
package kube
import (
"flag"
"fmt"
"os"
)
func init() {
if level := os.Getenv("KUBE_LOG_LEVEL"); level != "" {
flag.Set("vmodule", fmt.Sprintf("loader=%s,round_trippers=%s,request=%s", level, level, level))
flag.Set("logtostderr", "true")
}
}
Loading…
Cancel
Save