log

package
v0.0.0-...-c2bae5a Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ctx context.Context, kvs ...interface{}) context.Context

Add takes a context and an additional even number of arguments, interpreted as key-value pairs. These are added on top of the supplied context and the resulting context returned.

func Error

func Error(args ...interface{})

Error logs to the ERROR, WARNING, and INFO logs. Arguments are handled in the manner of fmt.Print; a newline is appended.

func ErrorDepth

func ErrorDepth(depth int, args ...interface{})

ErrorDepth logs to the ERROR, WARNING, and INFO logs, offsetting the caller's stack frame by 'depth'.

func Errorc

func Errorc(ctx context.Context, msg string, kvs ...interface{})

Errorc logs to the ERROR, WARNING, and INFO logs. It extracts values from Field keys specified in this package and logs them along with the given message and any additional pairs specified as consecutive elements in kvs.

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs to the ERROR, WARNING, and INFO logs. Don't use it; use Error Info or Errorc instead. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.

func Fatal

func Fatal(args ...interface{})

Fatal logs to the INFO, WARNING, ERROR, and FATAL logs, including a stack trace of all running goroutines, then calls os.Exit(255). Arguments are handled in the manner of fmt.Print; a newline is appended.

func FatalDepth

func FatalDepth(depth int, args ...interface{})

FatalDepth logs to the INFO, WARNING, ERROR, and FATAL logs, including a stack trace of all running goroutines, then calls os.Exit(255), offsetting the caller's stack frame by 'depth'.

func FatalOnPanic

func FatalOnPanic()

FatalOnPanic recovers from a panic and exits the process with a Fatal log. This is useful for avoiding a panic being caught through a CGo exported function or preventing HTTP handlers from recovering panics and ignoring them.

func Fatalc

func Fatalc(ctx context.Context, msg string, kvs ...interface{})

Fatalc logs to the INFO, WARNING, ERROR, and FATAL logs, including a stack trace of all running goroutines, then calls os.Exit(255). It extracts values from the context using the Field keys specified in this package and logs them along with the given message and any additional pairs specified as consecutive elements in kvs.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs to the INFO, WARNING, ERROR, and FATAL logs, including a stack trace of all running goroutines, then calls os.Exit(255). Arguments are handled in the manner of fmt.Printf; a newline is appended.

func Info

func Info(args ...interface{})

Info logs to the INFO log. Arguments are handled in the manner of fmt.Print; a newline is appended.

func InfoDepth

func InfoDepth(depth int, args ...interface{})

InfoDepth logs to the INFO log, offsetting the caller's stack frame by 'depth'.

func Infoc

func Infoc(ctx context.Context, msg string, kvs ...interface{})

Infoc logs to the WARNING and INFO logs. It extracts values from the context using the Field keys specified in this package and logs them along with the given message and any additional pairs specified as consecutive elements in kvs.

func Infof

func Infof(format string, args ...interface{})

Infof logs to the INFO log. Don't use it; use Info or Infoc instead. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.

func V

func V(level clog.Level) bool

V returns true if the logging verbosity is set to the specified level or higher.

func Warning

func Warning(args ...interface{})

Warning logs to the WARNING and INFO logs. Warningf logs to the WARNING and INFO logs. Don't use it; use Warning or Arguments are handled in the manner of fmt.Print; a newline is appended.

func WarningDepth

func WarningDepth(depth int, args ...interface{})

WarningDepth logs to the WARNING and INFO logs, offsetting the caller's stack frame by 'depth'.

func Warningc

func Warningc(ctx context.Context, msg string, kvs ...interface{})

Warningc logs to the WARNING and INFO logs. It extracts values from the context using the Field keys specified in this package and logs them along with the given message and any additional pairs specified as consecutive elements in kvs.

func Warningf

func Warningf(format string, args ...interface{})

Warningf logs to the WARNING and INFO logs. Don't use it; use Warning or Warningc instead. Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.

Types

type Field

type Field int

A Field is an integer used to enumerate allowed field names in structured log output.

const (
	ClusterID Field = iota
	NodeID          // the ID of the node
	StoreID         // the ID of the store
	RaftID          // the ID of the range
	Method          // the method being executed
	Client          // TODO: client on whose behalf we're acting
	Err             // a wrapped error message, if applicable
	Detail          // information intended for human eyes only
	Key             // a proto.Key related to this event.

)

func (Field) String

func (i Field) String() string

Jump to

Keyboard shortcuts

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