github.com/grailbio/base@v0.0.11/cmdutil/interactive/interactive.go (about)

     1  // Copyright 2018 GRAIL, Inc. All rights reserved.
     2  // Use of this source code is governed by the Apache-2.0
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package interactive is switching defaults for logging to not output
     6  // anything to stderr.
     7  //
     8  // All user-facing programs should use this via an import:
     9  //
    10  //   import _ "github.com/grailbio/base/cmdutil/interactive"
    11  package interactive
    12  
    13  import (
    14  	"flag"
    15  
    16  	// For the flag.Lookup calls.
    17  	_ "v.io/x/lib/vlog"
    18  )
    19  
    20  func init() {
    21  	fl := flag.Lookup("alsologtostderr")
    22  	fl.DefValue = "false"
    23  	if err := fl.Value.Set(fl.DefValue); err != nil {
    24  		panic(err)
    25  	}
    26  
    27  	fl = flag.Lookup("logtostderr")
    28  	fl.DefValue = "false"
    29  	if err := fl.Value.Set(fl.DefValue); err != nil {
    30  		panic(err)
    31  	}
    32  }