logs

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

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

func Logf

func Logf(format string, args ...interface{})

Logf logs the info.

Types

type KlogWriter

type KlogWriter struct{}

KlogWriter serves as a bridge between the standard logs package and the glog package.

func (KlogWriter) Write

func (writer KlogWriter) Write(data []byte) (n int, err error)

Write implements the io.Writer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL