My Error Logging
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.
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]
[edited by - EL on August 8, 2003 3:02:17 PM]
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
Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4
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.
Seriously, ANY extra information that I can include will help me in the long run.
Superpig, I tried using __FUNCTION__ with MSVC 6 and it didn''t compile. Is that only for other compilers? I''ve never even seen it before. Thanks
[JESUS SAVES]
[JESUS SAVES]
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement