package main
import (
"context"
"errors"
"fmt"
"github.com/infiniteloopcloud/log"
)
const (
CorrelationID log.ContextField = "correlation_id"
)
func main() {
// Set this globally
log.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...
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Yet another log package
License
infiniteloopcloud/log
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Yet another log package
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published