glogr

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 4 Imported by: 0

README

Added ErrorStack option to glogger

Documentation

Overview

Package glogr implements github.com/go-logr/logr.Logger in terms of github.com/golang/glog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() logr.Logger

New returns a logr.Logger which is implemented by glog.

func NewWithOptions

func NewWithOptions(opts Options) logr.Logger

NewWithOptions returns a logr.Logger which is implemented by glog.

Types

type ErrorStack

type ErrorStack int
const (
	NoStack ErrorStack = iota
	KVStack
	DebugStack
)

type MessageClass

type MessageClass int

MessageClass indicates which category or categories of messages to consider.

const (
	// None ignores all message classes.
	None MessageClass = iota
	// All considers all message classes.
	All
	// Info only considers info messages.
	Info
	// Error only considers error messages.
	Error
)

type Options

type Options struct {
	// Depth biases the assumed number of call frames to the "true" caller.
	// This is useful when the calling code calls a function which then calls
	// glogr (e.g. a logging shim to another API).  Values less than zero will
	// be treated as zero.
	Depth int

	// LogCaller tells glogr to add a "caller" key to some or all log lines.
	// The glog implementation always logs this information in its per-line
	// header, whether this option is set or not.
	LogCaller MessageClass

	// ErrorStack added by major1201
	ErrorStack ErrorStack
}

Options carries parameters which influence the way logs are generated.

Jump to

Keyboard shortcuts

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