Jump to content
  • Advertisement
Sign in to follow this  
paic

Redirecting driver errors to a file ?

This topic is 4612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, When you run DirectX with the debug runtime, and set the Deubg Output Level to the max, you can usually see a lot of warings / errors being sent to the Visual Debug Output. I'd like to redirect those messages to a log file, but I can't find any information on that. Do anyone know if it's possible ? And if so, how to do it ? Thx in advance.

Share this post


Link to post
Share on other sites
Advertisement
This is probably more of a General Programming question. Have a look at This article, and see if that helps. It's in MDX, but it should translate to C++ without much difficulty.

Share this post


Link to post
Share on other sites
Thx for the answer. I didn't read it in detail, but let me explain a little better my problem :

I'd like to redirect messages generated by the DirectX runtime. Not by my code. Those messages are stuff like :

"D3DX: Matrix should be 16-byte aligned for better performance"

And I don't have any control on that. It's not inside my code, there is no function to desactivate that, other than the DirectX configuration panel.

Share this post


Link to post
Share on other sites
Quote:
Original post by paic
Thx for the answer. I didn't read it in detail

Yea, go back and read it - it is exactly what you want. From within a process, you can capture all messages sent to OutputDebugStream() on its behalf. This will let you capture these messages and do whatever you want with it.

I should do this sometime too, it would be nice to have.

Share this post


Link to post
Share on other sites
Odds are the error messages are being sent to the standard error stream. Redirect that.

In C: stderr = freopen(stderr, stuff goes here)
In C++: std::cerr.rdbuf( stuff goes here )

Share this post


Link to post
Share on other sites
I thought that stderr ended up on stdout? Or it did the last time I tried it with VC6. Although it's entirely possible I was doing something wrong...

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
I thought that stderr ended up on stdout? Or it did the last time I tried it with VC6. Although it's entirely possible I was doing something wrong...


They both end up on the console by default, but they are two separate streams that can be independently redirected.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!