Update go dependencies
This commit is contained in:
parent
293223eea0
commit
b7a799bf82
432 changed files with 37346 additions and 25783 deletions
14
vendor/k8s.io/apiserver/pkg/util/logs/logs.go
generated
vendored
14
vendor/k8s.io/apiserver/pkg/util/logs/logs.go
generated
vendored
|
|
@ -26,13 +26,21 @@ import (
|
|||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
)
|
||||
|
||||
var logFlushFreq = pflag.Duration("log-flush-frequency", 5*time.Second, "Maximum number of seconds between log flushes")
|
||||
const logFlushFreqFlagName = "log-flush-frequency"
|
||||
|
||||
var logFlushFreq = pflag.Duration(logFlushFreqFlagName, 5*time.Second, "Maximum number of seconds between log flushes")
|
||||
|
||||
// TODO(thockin): This is temporary until we agree on log dirs and put those into each cmd.
|
||||
func init() {
|
||||
flag.Set("logtostderr", "true")
|
||||
}
|
||||
|
||||
// AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the
|
||||
// same value as the global flags.
|
||||
func AddFlags(fs *pflag.FlagSet) {
|
||||
fs.AddFlag(pflag.Lookup(logFlushFreqFlagName))
|
||||
}
|
||||
|
||||
// GlogWriter serves as a bridge between the standard log package and the glog package.
|
||||
type GlogWriter struct{}
|
||||
|
||||
|
|
@ -46,8 +54,8 @@ func (writer GlogWriter) Write(data []byte) (n int, err error) {
|
|||
func InitLogs() {
|
||||
log.SetOutput(GlogWriter{})
|
||||
log.SetFlags(0)
|
||||
// The default glog flush interval is 30 seconds, which is frighteningly long.
|
||||
go wait.Until(glog.Flush, *logFlushFreq, wait.NeverStop)
|
||||
// The default glog flush interval is 5 seconds.
|
||||
go wait.Forever(glog.Flush, *logFlushFreq)
|
||||
}
|
||||
|
||||
// FlushLogs flushes logs immediately.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue