Documentation
¶
Index ¶
- func Add(ctx context.Context, kvs ...interface{}) context.Context
- func Error(args ...interface{})
- func ErrorDepth(depth int, args ...interface{})
- func Errorc(ctx context.Context, msg string, kvs ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func FatalDepth(depth int, args ...interface{})
- func FatalOnPanic()
- func Fatalc(ctx context.Context, msg string, kvs ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func InfoDepth(depth int, args ...interface{})
- func Infoc(ctx context.Context, msg string, kvs ...interface{})
- func Infof(format string, args ...interface{})
- func V(level clog.Level) bool
- func Warning(args ...interface{})
- func WarningDepth(depth int, args ...interface{})
- func Warningc(ctx context.Context, msg string, kvs ...interface{})
- func Warningf(format string, args ...interface{})
- type Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
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 ¶
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 ¶
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 ¶
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 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'.
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. )