Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Plugins

Any way to get at stdout from plugins?  

ShiVa Plugin Development

Any way to get at stdout from plugins?

Postby flippout » 01 Nov 2011, 23:27

I'm trying to debug a problem in my plugin which uses some code that does printfs().
Is there any way to see stdout when a plugin is run from the editor?
flippout
Gold Boarder
Gold Boarder
 
Posts: 279

Re: Any way to get at stdout from plugins?

Postby giggsy » 02 Nov 2011, 09:41

how about S3DX::log. or so? =)
User avatar
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1103
Location: Austria

Re: Any way to get at stdout from plugins?

Postby flippout » 02 Nov 2011, 14:22

Indeed yes, that's what I'm doing now.

But it's a bit of a pain, as some of the code I'm using is also used in other solutions which don't include the S3DX headers.

Maybe I can pipe the output if I run the editor from the console? hmmm..
flippout
Gold Boarder
Gold Boarder
 
Posts: 279

Re: Any way to get at stdout from plugins?

Postby NiCoX » 02 Nov 2011, 14:28

Hi,

On Windows you can just compile your plug-in in Debug, attach the ShiVaEditor process to Visual Studio, and use OutputDebugString to print debug logs.

On other platforms, it depends: on some, printf will work, on others NSLog will work, etc.
User avatar
NiCoX
Platinum Boarder
Platinum Boarder
 
Posts: 5652
Location: France

Re: Any way to get at stdout from plugins?

Postby flippout » 02 Nov 2011, 14:32

It seems the express version of Visual Studio doesn't support attach to process :(

Not a big deal... Maybe I can redefine printf somehow to do an S3DX::log.message() when compiling a plugin...
flippout
Gold Boarder
Gold Boarder
 
Posts: 279

Re: Any way to get at stdout from plugins?  

Postby flippout » 02 Nov 2011, 14:35

Actually I take that back - I just discovered that I can enable that feature through tools->settings->expert settings. Sweeeet! No more log debugging!
flippout
Gold Boarder
Gold Boarder
 
Posts: 279


Return to Plugins