verbosity

package
v2.130.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int32

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

type VState

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

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

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

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

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

Jump to

Keyboard shortcuts

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