grpc_logger.go 371 B

12345678910111213141516
  1. package fslog
  2. import (
  3. "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
  4. "google.golang.org/grpc"
  5. )
  6. func GRPCStreamServerLogger() grpc.StreamServerInterceptor {
  7. lazyInitialize()
  8. return grpc_zap.StreamServerInterceptor(logger)
  9. }
  10. func GRPCUnaryServerLogger() grpc.UnaryServerInterceptor {
  11. lazyInitialize()
  12. return grpc_zap.UnaryServerInterceptor(logger)
  13. }