grpc/rpclog/grpc.go
func UnaryServerInterceptor(log ttnlog.Interface) grpc.UnaryServerInterceptor {
	return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
		log := getLog(log).WithField("method", info.FullMethod)
		log = log.WithFields(FieldsFromIncomingContext(ctx))
		start := time.Now()
		resp, err = handler(ctx, req)
		log = log.WithField("duration", time.Since(start))
		if err != nil {
			log.WithError(err).Debug("rpc-server: call failed")
			return
		}
		log.Debug("rpc-server: call done")
		return
	}
}
func UnaryServerInterceptor(log ttnlog.Interface) grpc.UnaryServerInterceptor {
	return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
		log := getLog(log).WithField("method", info.FullMethod)
		log = log.WithFields(FieldsFromIncomingContext(ctx))
		start := time.Now()
		resp, err = handler(ctx, req)
		log = log.WithField("duration", time.Since(start))
		if err != nil {
			log.WithError(err).Debug("rpc-server: call failed")
			return
		}
		log.Debug("rpc-server: call done")
		return
	}
}
// UnaryServerInterceptor logs unary RPCs on the server side