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