Level must be an int32 to support atomic read/writes.
type Level int32
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() *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 (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 (vs *VState) V() Value
func (vs *VState) VModule() Value
Value is an extension that makes it possible to use the values in pflag.
type Value interface { flag.Value Type() string }