klog

package
v0.0.0-...-5f133c6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLevels = Levels{
	{"debug", zapcore.DebugLevel},
	{"info", zapcore.InfoLevel},
	{"warning", zapcore.WarnLevel},
	{"error", zapcore.ErrorLevel},
}

Functions

func Syslog

func Syslog(tag string, sl syslog.Priority, zl zapcore.Level) (zapcore.Core, error)

Types

type Flags

type Flags struct {
	ConsoleLevel string
	SyslogLevel  string
	Verbosity    int
	Quiet        bool
}

func DefaultFlags

func DefaultFlags() *Flags

func (*Flags) Register

func (cf *Flags) Register(flags kflags.FlagSet, prefix string) *Flags

type Level

type Level struct {
	Name  string
	Value zapcore.Level
}

type Levels

type Levels []Level

func (Levels) Find

func (levels Levels) Find(name string) (int, *Level)

func (Levels) String

func (levels Levels) String() string

type Logger

type Logger struct {
	*zap.SugaredLogger
}

func New

func New(name string, mods ...Modifier) (*Logger, error)

func (*Logger) SetOutput

func (l *Logger) SetOutput(writer io.Writer)

type Modifier

type Modifier func(o *options) error

func FromFlags

func FromFlags(flags Flags) Modifier

type Modifiers

type Modifiers []Modifier

func (Modifiers) Apply

func (mods Modifiers) Apply(o *options) error

Jump to

Keyboard shortcuts

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