log is a powerful logging framework that provides log custom log level.
log provides Fatal, Error , Warn, Info, Debug level log.
Use Log just as you would use print.
func main(){
ctx := context.Background()
v, err := rand.Int(rand.Reader, big.NewInt(int64(16)))
if err != nil {
log.ErrorContext(ctx, " rand.In failed", "error", err.Error())
return
}
log.InfoContext(ctx, "the rand Int result", "v", v)
}
This use is made of the key and the Value output.
This is free software distributed under the terms of the MIT license