Sign in to follow this  
paic

Redirecting driver errors to a file ?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this