package funcr

import "github.com/go-logr/logr/funcr"

Package funcr implements github.com/go-logr/logr.Logger in terms of an arbitrary "write" function.

Index

Functions

func New

func New(fn func(prefix, args string), opts Options) logr.Logger

New returns a logr.Logger which is implemented by an arbitrary function.

Types

type MessageClass

type MessageClass int

MessageClass indicates which category or categories of messages to consider.

const (
	None MessageClass = iota
	All
	Info
	Error
)

type Options

type Options struct {
	// LogCaller tells funcr to add a "caller" key to some or all log lines.
	// This has some overhead, so some users might not want it.
	LogCaller MessageClass

	// Verbosity tells funcr which V logs to be write.  Higher values enable
	// more logs.
	Verbosity int
}

Options carries parameters which influence the way logs are generated.

Source Files

funcr.go

Version
v1.0.0
Published
Jul 6, 2021
Platform
darwin/amd64
Imports
8 packages
Last checked
2 minutes ago

Tools for package owners.