Archived

This topic is now archived and is closed to further replies.

Krakken

My Error Logging

Recommended Posts

Hi, I have just finished a small error logging system and it''s quite nifty. The only problem is, it only shows what it was attempting and at what time. Are there any other useful variables as such that I can also log to help me when coming back to debug? Anything will help such as the memory address or whatever. The more I can log about the occurence the better I will be able to debug it. Thanks, Nat.

Share this post


Link to post
Share on other sites
Well, I can't think of anything else. Maybe you could include errors you catch or throw or something (if you are one of the few people who does that )

[edited by - EL on August 8, 2003 3:02:17 PM]

Share this post


Link to post
Share on other sites
You could look into the __LINE__, __FILE__ and __FUNCTION__ preprocessor symbols. That should let you add information about where the error is actually occuring to your reports.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

Share this post


Link to post
Share on other sites
Thanks for those. The only problem is I wanted to do it from within the logging class. Those are preprocessor macros right? Is there any way to get maybe a small memory dump of the current execution? I can understand it being fairly advanced but I am willing to learn.

Seriously, ANY extra information that I can include will help me in the long run.

Share this post


Link to post
Share on other sites
You should be able to dump the current state of the stack (in the function you are in), perhaps use some inline assembly code to keep track of the stack pointer? For instance, always keep a variable that holds the difference between the stack pointer for the entry point of the current function and the entry point of the calling function. I''m no expert myself so I''m not entirely sure how to do this, or if it can be done.

Share this post


Link to post
Share on other sites