Page 1 of 1

Possible to Write to VS Output Window?

PostPosted: July 10th, 2017, 5:24 pm
by hk1
Is it possible to write to the Visual Studio Output Window? I'm using PHP Tools with Visual Studio 2015 and am also using X-Debug and I'd like to be able to put some kind of print statement in my PHP that writes out to the Output > Debug window.

Re: Possible to Write to VS Output Window?

PostPosted: July 11th, 2017, 2:47 pm
by Miloslav Beno
Hello!

You might want to use "Tracepoints". Just create a breakpoint then to hover the breakpoint sign and select settings symbol. It will open a breakpoint settings dialog where you canfill the log message in to the Actions section.

The log message can cointan text and curly braces where you can include php expression which is going to be evaluated once the location is reached. e.g. "The value of $x is {$x}".

tracepoint.png


This way you don't need to modify your code and you will get what you want.

Hope that will help!

Cheers,

.

PostPosted: December 5th, 2018, 8:14 am
by uwe
I'm also looking for a way to directly write to the VS Output Windows.

I absolutely want to do it by code.

Is there really no way to do it by code?

Re: Possible to Write to VS Output Window?

PostPosted: December 18th, 2018, 1:38 am
by jazz
Any output from PHP will be sent to the browser. For this to work in PHP Tools, XDebug would have to support it and XDebug does not do anything like that.

If you want to log output from your application, write to a file or take a look at something like Firebug or Chrome Logger.