This is a logger library that uses logrus to implement the Hertz logger interface
Download and install it:
go get github.com/hertz-contrib/logger/logrus
Import it in your code:
import hertzlogrus github.com/hertz-contrib/logger/logrus
Simple Example:
package main
import (
"context"
"github.com/cloudwego/hertz/pkg/common/hlog"
hertzlogrus "github.com/hertz-contrib/logger/logrus"
)
func main() {
logger := hertzlogrus.NewLogger()
hlog.SetLogger(logger)
...
hlog.CtxInfof(context.Background(), "hello %s", "hertz")
}