I need to capture the event when my application is trying to write something on console.
Console.WriteLine("Any text");
Is it possible to get the text sent to console output in an event or method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One approach would be to create a new stream override, as shown in this article:
http://mel-green.com/2010/01/progressstream/
Then, you would need to set this as the stream that Console writes to, e.g.
Then use the events of the progress stream to see when it is written to.