You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
379 B

package config
import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc/grpclog"
"sonet/pkg/utils/logger"
)
func InitLogger(grpcLog bool) {
logrus.SetFormatter(&logrus.TextFormatter{
ForceColors: true,
TimestampFormat: "2006-01-02 15:04:05", //时间格式
FullTimestamp: true,
})
// logging grpc
if grpcLog {
grpclog.SetLoggerV2(logger.Logger)
}
}