Categorygithub.com/KeKe-Li/log
repositorypackage
0.0.0-20220106013756-b7732f599735
Repository: https://github.com/keke-li/log.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

go log system

log is a powerful logging framework that provides log custom log level.

log provides Fatal, Error, Warn, Info, Debug level log. and with the requestID can quickly go to the current line of code.

If you like,please give a star。

How to Use

it's very simple and easy to use.

func main(){
	l := log.New(log.WithTraceId(trace.NewTraceId()))
	ctx := log.NewContext(context.Background(), l)
	
	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.

License

This is free software distributed under the terms of the MIT license