Skip to content
/ lad Public
forked from uber-go/zap

Blazing fast, structured, leveled logging in Go.

License

Notifications You must be signed in to change notification settings

tnngo/lad

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lad

Add context logger for zap.

Zap logo

Installation

go get -u github.com/tnngo/lad

Change

Support for logging contextual metadata,

defineContext := Context(func(ctx context.Context) []Field {
  var fields []Field

  if dc, ok := ctx.Value(requestID).(string); ok {
  	fields = append(fields, String(string(requestID), dc))
  }

  return fields
})

logger, _ := lad.NewDevelopment(defineContext)

ctx := context.TODO()
ctx = context.WithValue(ctx, requestID, "123456789")

logMessage := "tnngo"

logger.WithContext(ctx).Info(logMessage)
logger.WithContext(ctx).Debug("1")
logger.Sugar().WithContext(ctx).Debug(2)

About

Blazing fast, structured, leveled logging in Go.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.7%
  • Other 0.3%