Visualizing the BVH?

Hi folks,

Is there any inbuilt way to dump the BVH to a text file or visualize it somehow in Cycles?

I would like to dump out the traversal history of BVH nodes for each ray to a text file, what’s the best place to put this code in such that I can write to a different file for traversal history for rays in each tile (i.e. one file per tile) ? If there’s already something inbuilt in the logging classes that would be great.