VS Code has a concept called "log points" in the C/C++ debug mode that use a debugger to implement logging.
So you can combine the best of debugging and logging.
At Undo we've done some investigation of how to get this out into the world for time travel debug, so it's interesting to see your idea lines up.
What sort of problem do you think this would be useful for?