Documentation
¶
Index ¶
Constants ¶
View Source
const ( // LogFlushFreqDefault is the default for the corresponding command line // parameter. LogFlushFreqDefault = 5 * time.Second )
Variables ¶
View Source
var Fail = ginkgo.Fail
Fail is an alias for ginkgo.Fail.
Functions ¶
func Failf ¶
func Failf(format string, args ...interface{})
Failf logs the fail info, including a stack trace starts with its direct caller (for example, for call chain f -> g -> Failf("foo", ...) error would be logged for "g").
func FlushLogs ¶
func FlushLogs()
FlushLogs flushes logs immediately. This should be called at the end of the main function via defer to ensure that all pending logs messages are printed before exiting the program.
func InitLogs ¶
func InitLogs()
InitLogs disables support for contextual logs in klog while that Kubernetes feature is not considered stable yet. Commands which want to support contextual logs can:
- call klog.EnableContextualLogging after calling InitLogs, with a fixed `true` or depending on some command line flag or a feature gate check
- set up a FeatureGate instance, the advanced logs configuration with Options and call Options.ValidateAndApply with the FeatureGate; k8s.io/component-base/logs/example/cmd demonstrates how to do that
Types ¶
type KlogWriter ¶
type KlogWriter struct{}
KlogWriter serves as a bridge between the standard logs package and the glog package.
Click to show internal directories.
Click to hide internal directories.