func StreamNamespaceHook(namespace string) hooks.StreamHandlerMiddleware {
	return func(h grpc.StreamHandler) grpc.StreamHandler {
		return func(srv interface{}, stream grpc.ServerStream) error {
			wrapped := grpc_middleware.WrapServerStream(stream)
			wrapped.WrappedContext = log.NewContextWithField(stream.Context(), "namespace", namespace)
			return h(srv, wrapped)
		}
	}
}
StreamNamespaceHook adds the component namespace to the context of the stream.
package rpclog
import (
	"context"
	grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
	"go.thethings.network/lorawan-stack/v3/pkg/log"
	"go.thethings.network/lorawan-stack/v3/pkg/rpcmiddleware/hooks"
	"google.golang.org/grpc"
)
const NamespaceHook = "namespace"
func UnaryNamespaceHook(namespace string) hooks.UnaryHandlerMiddleware {
	return func(h grpc.UnaryHandler) grpc.UnaryHandler {
		return func(ctx context.Context, req interface{}) (interface{}, error) {
			ctx = log.NewContextWithField(ctx, "namespace", namespace)
			return h(ctx, req)
		}
	}
}