Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Redirect PrintMessage

More
5 years 4 months ago #1352 by wael
Redirect PrintMessage was created by wael
Hi,

I redirected cout from netgen to show on GUI, however, I cannot see output from PrintMessage calls
How is PrintMessage implemented and how can I redirect it please?

Thanks in advance

Regards

Wael
More
5 years 4 months ago #1354 by wael
Replied by wael on topic Redirect PrintMessage
I think I found a fix for this by redirecting stderr, not only stdout:

freopen (cout_file, "w", stdout);
setvbuf (stdout, NULL, _IONBF, 0);

freopen (error_file, "w", stderr);
setvbuf (stderr, NULL, _IONBF, 0);

Hope this helps somebody ;)
Time to create page: 0.146 seconds