Help us shape the future of Go! Take the 2026 Go Developer Survey

glogr

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 26

README

Minimal Go logging using glog

This package implements the logr interface in terms of Google's glog. This provides a relatively minimalist API to logging in Go, backed by a well-proven implementation.

This is a BETA grade implementation.

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 added in v0.2.0

func NewWithOptions(opts Options) logr.Logger

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

Types

type MessageClass added in v0.4.0

type MessageClass int
const (
	None MessageClass = iota
	All
	Info
	Error
)

type Options added in v0.2.0

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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