Log messages to VS output window?

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Log messages to VS output window?

Postby bornste » November 1st, 2012, 7:27 am

Hi all

As a long time .NET developer I'm used to log messages to the output window of Visual Studio.

Is it somehow possible to log messages to the output window from PHP? I tried error_log but without success.

Is there any possibility to achieve this?

Thanks for any answer in advance.
Stefan
bornste
 
Posts: 15
Joined: September 10th, 2012, 5:47 am
Location: Switzerland

Re: Log messages to VS output window?

Postby Miloslav Beno » November 1st, 2012, 6:02 pm

Hi Stefan,

that seems to be relatively easy to implement. We'll include this in the next update.

Thank you
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Log messages to VS output window?

Postby bornste » December 12th, 2012, 3:48 pm

Hi Miloslav,
any news on this?

I have the latest beta installed (1.5.3776) but it doesn't seem to work. If you have this feature already implemented how am I able to log to the output window? Does it work when debugging with a custom webserver?

Thanks for a short answer!
Stefan
bornste
 
Posts: 15
Joined: September 10th, 2012, 5:47 am
Location: Switzerland

Re: Log messages to VS output window?

Postby Miloslav Beno » December 12th, 2012, 7:22 pm

Hi Stefan,

Unfortunatelly it's not in the current release. This would be easy to implement on our end(basicaly support is already there), unfortunatelly it turned out that XDebug doesn't support it even that DBGp protocol does.

XDebug just supports to forward complete output, which is kind of useless I think.

I'll speak with the creator of XDebug to see if he could include support for this in some of the next releases.

Other alternative would be just to ready error_log file and post it to Output window. Which isn't quite nice, I'd prefer more elegant way to do it. And it wouldn't work for custom server as we are not able to locate this file automaticaly.
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Log messages to VS output window?

Postby hans » December 12th, 2012, 11:38 pm

Of course it would be cool to have this built in, but I was able to make a dumb socket client/server pretty quickly in PHP.

For the server you can just output everything you receive, then you can make a client function called console_log or something in your project's code. Configure it in Visual Studio => Tools => External Tools and check the "Use output window" box. Consider var_export($stuff, true) also. Works like a champ.

http://php.net/manual/en/book.sockets.php
hans
 
Posts: 12
Joined: December 12th, 2012, 11:32 pm

Re: Log messages to VS output window?

Postby Miloslav Beno » December 13th, 2012, 12:13 pm

Hi Hans,

Nice! That's a nice way how to achive this until there is something built-in. If you wouldn't mind sharing your tool (e.g. here or on github) I think other users would appreciate it.

Thank you
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 45 guests

cron

User Control Panel

Login

Who is online

In total there are 45 users online :: 0 registered, 0 hidden and 45 guests (based on users active over the past 5 minutes)
Most users ever online was 287 on March 29th, 2024, 6:11 am

Users browsing this forum: No registered users and 45 guests