I call a method, say, FizzBuzz(), over which I have no control. This method outputs a bunch of stuff to the Console using Console.WriteLine.
Is it possible for me to intercept the output being generated by the FizzBuzz method?
Note that my application is a Console app itself.
Yes, very much possible:
Later on if you want to stop intercepting the console output, use modification below:
Or the OpenStandardOutput does the same without the need to save the standard stream first: