8000 GitHub - lingling1420q/log-1: log for service
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lingling1420q/log-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go log system

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

log provides Fatal, Error, Warn, Info, Debug level log.

if you like,please star。

How to Use

Use Log just as use println, 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

About

log for service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
0