2

Sometimes when I'm writing unit tests, I want to debug the test and see the standard output (console output?) as I'm stepping through the code. In my case, my ORM is generating sql queries and showing them in stdout and I'd like to know what its generating.

I think I can't see the output because it's being directed to the test results window. Anyway, I'd like it better if I could see it in the output window while debugging, instead of waiting for the end of the test to see all the output.

Does anyone know how fix this?

Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90
  • Is there a reason you can't use System.Diagnostics.Debug.WriteLine to write to Debug instead of to Output? Conceptually, you are debugging. Alternatively, you can use something like log4net which allows you to set configuration information on what to output and where, which can also be valuable when running in production. – Michael Maddox Jun 26 '12 at 10:45
  • What i'm interested in is the nhibernate console output, i don't know of a way to direct it to the debug.writeline stream. However I could probably set up log4net if i really needed to. – Isaac Bolinger Jun 29 '12 at 18:48
  • You may be interested in my answer to this question: http://stackoverflow.com/questions/2134565/ It's not clear what you are doing to cause nhibernate to send output to the console, but it's very possible it is because you are setting ShowSql to true. – Michael Maddox Jun 30 '12 at 11:37
  • Yep, that's what I'm doing. I'll have to look into log4net sometime I guess. – Isaac Bolinger Jun 30 '12 at 20:06

0 Answers0