lormatter/README.md

24 lines
394 B
Markdown
Raw Normal View History

2023-04-02 16:01:19 +00:00
## Sample Usage
Sample usage using available option to format output
```go
package main
import (
"github.com/sirupsen/logrus"
2023-04-09 12:35:08 +00:00
"gitter.top/coco/lormatter"
2023-04-02 16:01:19 +00:00
)
func main() {
2023-04-09 12:35:08 +00:00
formatter := lormatter.Formatter{}
logrus.SetFormatter(formatter)
logrus.SetReportCaller(true)
logrus.Printf("Log message")
2023-04-02 16:01:19 +00:00
}
```
2023-04-09 12:35:08 +00:00
Above sample will produce:
2023-04-02 16:01:19 +00:00
```bash
2023-04-09 12:35:08 +00:00
[INFO] [2023-04-08 19:16:55.000] Log message
2023-04-02 16:01:19 +00:00
```