Capture stdout into String

Is there any way to capture the stdout from my app?

It is for debugging purposes, I use my own plugin host (made with juce), and I like to capture the plugin/s juce DBG("") output into my app/host, something like a debugging console.
Thanks

check the Logger class and example on introjucer;

it does exactly that, you can add messages to log and it gets printed to stdout and written to fileā€¦

Thanks Carlos!