示例#1
0
// RedirectGrpclog will redirect grpclog to lion.
func RedirectGrpclog() {
	lion.AddGlobalHook(
		func(l lion.Logger) {
			grpclog.SetLogger(NewLogger(l))
		},
	)
}
示例#2
0
// Register registers the default lion Logger as the dlog Logger.
func Register() {
	lion.AddGlobalHook(
		func(lionLogger lion.Logger) {
			dlog.SetLogger(NewLogger(lionLogger))
		},
	)
}
示例#3
0
func init() {
	if err := lion.RegisterEncoderDecoder(Encoding, newEncoderDecoder()); err != nil {
		panic(err.Error())
	}
	lion.SetJSONMarshalFunc(DefaultJSONMarshalFunc)
	lion.AddGlobalHook(setGlobalLogger)
}
示例#4
0
func init() {
	if err := lion.RegisterEncoderDecoder(
		Encoding,
		newEncoderDecoder(
			Encoding,
			thrift.NewTBinaryProtocolFactory(
				true,
				true,
			),
		),
	); err != nil {
		panic(err.Error())
	}
	lion.AddGlobalHook(setGlobalLogger)
}