Update readme

This commit is contained in:
jar3b 2018-06-29 00:16:51 +03:00
parent 844119673f
commit 4a7cf3111a

View File

@ -8,4 +8,23 @@ Logrus (https://github.com/sirupsen/logrus) formatter with messages like
Configure Configure
... ```
import (
log "github.com/sirupsen/logrus"
"github.com/jar3b/logrus-levelpad-formatter"
"os"
)
func InitLog() {
log.SetFormatter(&levelpad.Formatter{
TimestampFormat: "2006-01-02 15:04:05.000",
LogFormat: "[%lvl%][%time%] %msg%\n",
LevelPad: 8,
})
log.SetOutput(os.Stdout)
// Only log the info severity or above.
log.SetLevel(log.InfoLevel)
}
```