mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
Fresh dep ensure
This commit is contained in:
28
vendor/k8s.io/klog/examples/coexist_glog/coexist_glog.go
generated
vendored
Normal file
28
vendor/k8s.io/klog/examples/coexist_glog/coexist_glog.go
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
type glogWriter struct{}
|
||||
|
||||
func (file *glogWriter) Write(data []byte) (n int, err error) {
|
||||
glog.InfoDepth(0, string(data))
|
||||
return len(data), nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Set("alsologtostderr", "true")
|
||||
|
||||
var flags flag.FlagSet
|
||||
klog.InitFlags(&flags)
|
||||
flags.Set("skip_headers", "true")
|
||||
flag.Parse()
|
||||
|
||||
klog.SetOutput(&glogWriter{})
|
||||
klog.Info("nice to meet you")
|
||||
glog.Flush()
|
||||
klog.Flush()
|
||||
}
|
14
vendor/k8s.io/klog/examples/log_file/usage_log_file.go
generated
vendored
Normal file
14
vendor/k8s.io/klog/examples/log_file/usage_log_file.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
func main() {
|
||||
klog.InitFlags(nil)
|
||||
flag.Set("log_file", "myfile.log")
|
||||
flag.Parse()
|
||||
klog.Info("nice to meet you")
|
||||
klog.Flush()
|
||||
}
|
22
vendor/k8s.io/klog/examples/set_output/usage_set_output.go
generated
vendored
Normal file
22
vendor/k8s.io/klog/examples/set_output/usage_set_output.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
func main() {
|
||||
klog.InitFlags(nil)
|
||||
flag.Set("logtostderr", "false")
|
||||
flag.Set("alsologtostderr", "false")
|
||||
flag.Parse()
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
klog.SetOutput(buf)
|
||||
klog.Info("nice to meet you")
|
||||
klog.Flush()
|
||||
|
||||
fmt.Printf("LOGGED: %s", buf.String())
|
||||
}
|
Reference in New Issue
Block a user