logger

command
Version: v0.0.0-...-f1d4689 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 7 Imported by: 0

README

Logger Example

Zap

$ go run logger/main.go -logger=zap

$ curl http://localhost:8080/log
{"level":"info","msg":"Listening on :8080.\n"}
{"level":"debug","msg":"debug msg"}
{"level":"debug","msg":"debugf msg"}
{"level":"info","msg":"debug"}
{"level":"info","msg":"debugf"}
{"level":"warn","msg":"warn msg"}
{"level":"warn","msg":"warnf msg"}
{"level":"error","msg":"error msg"}
{"level":"error","msg":"errorf msg"}
...

Logrus

$ go run logger/main.go -logger=logrus

$ curl http://localhost:8080/log
INFO[0001] debug                                        
INFO[0001] debugf                                       
WARN[0001] warn msg                                     
WARN[0001] warnf msg                                    
ERRO[0001] error msg                                    
ERRO[0001] errorf msg 
...

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL