...

Package verbosity

import "k8s.io/klog/v2/internal/verbosity"
Overview
Index

Overview ▾

type Level

Level must be an int32 to support atomic read/writes.

type Level int32

type VState

VState contains settings and state. Some of its fields can be accessed through atomic read/writes, in other cases a mutex must be held.

type VState struct {
    // contains filtered or unexported fields
}

func New

func New() *VState

New returns a struct that implements -v and -vmodule support. Changing and checking these settings is thread-safe, with all concurrency issues handled internally.

func (*VState) Enabled

func (vs *VState) Enabled(level Level, depth int) bool

Enabled checks whether logging is enabled at the given level. This must be called with depth=0 when the caller of enabled will do the logging and higher values when more stack levels need to be skipped.

The mutex will be locked only if needed.

func (*VState) V

func (vs *VState) V() Value

func (*VState) VModule

func (vs *VState) VModule() Value

type Value

Value is an extension that makes it possible to use the values in pflag.

type Value interface {
    flag.Value
    Type() string
}