Update readme
This commit is contained in:
parent
844119673f
commit
4a7cf3111a
21
README.md
21
README.md
@ -8,4 +8,23 @@ Logrus (https://github.com/sirupsen/logrus) formatter with messages like
|
||||
|
||||
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)
|
||||
}
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user