Wrapper for quick and easy work with the logrus package in golang
go get github.com/ret0rn/l0gger
JsonFormater
TextFormater
DebugLvl
InfoLvl
WarningLvl
ErrorLvl
FatalLvl
Log Level | Log Messages |
---|---|
DEBUG | DEBUG, INFO, WARNING, ERROR, FATAL |
INFO | INFO, WARNING, ERROR, FATAL |
WARNING | WARNING, ERROR, FATAL |
ERROR | ERROR, FATAL |
FATAL | FATAL |
- File
- Сonsole
- Others
io.Writer
's
var log, err = l0gger.New([1], [2], [3])
-
Log Out
- type
string
- log to file nil
oros.Stdout
- log to console- type
io.Writer
- others io.Writers
- type
-
Formaters
-
JsonFormater
- JSON Formater{"file":"test.go:18","level":"info","msg":"hello","time":"2022-06-19T22:14:02+03:00"}
-
TextFormater
- Text Formatertime="2022-06-19T22:15:01+03:00" level=info msg=hello file="test.go:18"
-
-
Level
DebugLvl
InfoLvl
WarningLvl
ErrorLvl
FatalLvl
import "github.com/ret0rn/l0gger"
func main() {
var log, err = l0gger.New(nil, l0gger.JsonFormater, l0gger.DebugLvl)
log.Info("Info test")
}
import "github.com/ret0rn/l0gger"
func main() {
var log, err = l0gger.New("logger.log", l0gger.JsonFormater, l0gger.DebugLvl)
log.Info("Info test")
}