Skip to content

Repository files navigation

Log

Usage

package main
import (
"context""errors""fmt""github.com/infiniteloopcloud/log"
)
const (
CorrelationID log.ContextField="correlation_id"
)
funcmain() {
// Set this globallylog.SetLevel(log.LevelToUint())
log.SetLoggableFields([]fmt.Stringer{CorrelationID})
ctx:=context.Background()
ctx=context.WithValue(ctx, CorrelationID, "123456")
log.Error(ctx, errors.New(""), "")
log.Errorf(ctx, errors.New(""), "test: %s", "test")
log.Warn(ctx, "")
log.Info(ctx, "")
log.Debug(ctx, "")
// etc...
}

About

Yet another log package

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages