logrus formatter easy.
Go to file
2024-02-03 01:24:29 +08:00
.gitignore first commit 2023-04-03 00:01:19 +08:00
formatter_test.go release: version v0.0.1 2024-02-03 01:24:29 +08:00
formatter.go release: version v0.0.1 2024-02-03 01:24:29 +08:00
go.mod release: version v0.0.1 2024-02-03 01:24:29 +08:00
go.sum release: version v0.0.1 2024-02-03 01:24:29 +08:00
LICENSE first commit 2023-04-03 00:01:19 +08:00
README.md release: version v0.0.1 2024-02-03 01:24:29 +08:00

Sample Usage

Sample usage using available option to format output

package main

import (
	"github.com/sirupsen/logrus"
	"gitter.top/coco/lormatter"
)

func main() {
	formatter := lormatter.Formatter{}
	logrus.SetFormatter(formatter)
	logrus.SetReportCaller(true)
	logrus.Printf("Log message")
}

Above sample will produce:

[INFO] [2023-04-08 19:16:55.000] Log message