views:

1278

answers:

8

in visual studio 2005 how can i save whats written to the out put window to file (i cant change the code writing to the output window and it writes a lot i just want to save the output window content to file)

thank you Arik

A: 

ATLTrace Tool intercepts the ATLTRACE calls. You can save the output of any process into a file.

xtofl
A: 

Are you developing in .NET? And what is the code used to write to the output window?

In case you are using Trace.WriteLine or Debug.WriteLine you could use a TextWriterFileListener class to write all messages to a file automatically.

0xA3
+1  A: 

If the app runs in a command window, you can use the old DOS redirect command ">" to redirect the output to a file.

For example.

c:\>dir > out.txt

...will redirect the output of the dir command to a file called out.txt. You should be able to do the same with your application.

This will stop the output from going to the console, but you can always go the log file to get you the info you want.

StingyJack
There are programs that can be piped to, and will split the output (e.g. tee on unix systems). This does _not_, however, capture the VS output window: that one's populated by ATLTRACE calls, and can be captured by ATLTraceTool.
xtofl
A: 

thank you for your answers however i'm developing in c++ and i just want the output window to be written into file rather then to the window. I'm running the program in visual studio debug mode anyone? i would rather not doing it using an outside tool like ATLTRace Tool can anyone tell we how to configure the IDE itself?

thx

+2  A: 

"File" -> "SaveOutputAs..." let's you save the contents of the output window to a file, but I imagine you want to redirect the output to a file while debugging? I'm still looking for a way to do that myself..

jeebus
+1  A: 

If you mean the output to the debug/trace window.
You can capture this at runtime with debugview without running visual studio.

Martin Beckett
A: 

http://www.dilascia.com/TraceWin.htm

A: 

Just answered a very similar question here. I'm using this method myself to capture, filter and log debug output to a file on Vista 32. I use Visual Studio 2005 and work in C++, so this might help you too.

carleeto