How do I redirect output from the Visual Studio debugger?
        Posted  
        
            by jeatsy
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by jeatsy
        
        
        
        Published on 2010-04-06T17:30:31Z
        Indexed on 
            2010/04/06
            17:33 UTC
        
        
        Read the original article
        Hit count: 365
        
In Visual Studio 2008, I can specify a message to be printed when a breakpoint is hit (by right-clicking the breakpoint and choosing 'When Hit...'). When the program is run, these messages appear in the Output Window. I would like to know, is there any way to redirect them to a file?
Specifying >file.txt as a command argument to the program does not work: this redirects the program's output, but not the debugger's.
(FWIW the behaviour I wish to achieve is to get the debugger to repeatedly print a variable's value to a file, rather than peppering my code with printf/cout statements.)
© Stack Overflow or respective owner