Merge pull request #704 from psvo/fix-klog-output-configuration
Use a discarding writer for klog outputmine
commit
3d725c0717
|
|
@ -3,6 +3,7 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/client"
|
"github.com/derailed/k9s/internal/client"
|
||||||
|
|
@ -46,9 +47,7 @@ func init() {
|
||||||
|
|
||||||
// Klogs (of course) want to print stuff to the screen ;(
|
// Klogs (of course) want to print stuff to the screen ;(
|
||||||
klog.InitFlags(nil)
|
klog.InitFlags(nil)
|
||||||
if err := flag.Set("log_file", "/dev/null"); err != nil {
|
klog.SetOutput(ioutil.Discard)
|
||||||
log.Error().Err(err)
|
|
||||||
}
|
|
||||||
if err := flag.Set("stderrthreshold", "fatal"); err != nil {
|
if err := flag.Set("stderrthreshold", "fatal"); err != nil {
|
||||||
log.Error().Err(err)
|
log.Error().Err(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue