Thread: [GD-General] runtime error logging
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2003-07-14 15:41:43
|
There are some cases when I have to deal with runtime errors that cannot be seen before, such as when the user executes an invalid script. I can handle these events, but I would also like to log them somewhere. The problem is that these invalid events may happen in every frame (or even multiple times a frame) flooding the log file in no time... Any ideas on how I could do "singleton" logging of errors? Can't think of any simple solution :( thanks, Bandi |
From: Stefan B. <ste...@te...> - 2003-07-14 16:10:27
|
> Any ideas on how I could do "singleton" logging of errors? > Can't think of any simple solution :( Would this work ok in your case? #define Singleton_Log(x) { static bool bSeen = false; \ if (bSeen == false) { bSeen = true; LogMessage(x) } } Cheers, Stef! :) -- Stefan Boberg, R&D Manager - Team17 Software Ltd. bo...@te... |
From: Andras B. <bn...@ma...> - 2003-07-15 17:00:08
|
Monday, July 14, 2003, 6:11:21 PM, Stefan Boberg wrote: >> Any ideas on how I could do "singleton" logging of errors? >> Can't think of any simple solution :( > Would this work ok in your case? > #define Singleton_Log(x) { static bool bSeen = false; \ > if (bSeen == false) { bSeen = true; LogMessage(x) } } No, not really. :( The problem is that I handle errors at one place, and I would like to report many different errors and warnings, but only once each. b |
From: Peter L. <pe...@to...> - 2003-07-15 19:22:03
|
you just need a signature you can check against a database of what's been reported. If you have printf-style log messages, you can generate the signature from the string; use the format-string if you want to limit reports by class, or the output string if you have a more particular definition of 'already seen error'. Peter > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Andras Balogh > Sent: Tuesday, July 15, 2003 5:18 AM > To: Stefan Boberg > Subject: Re: [GD-General] runtime error logging > > > Monday, July 14, 2003, 6:11:21 PM, Stefan Boberg wrote: > > >> Any ideas on how I could do "singleton" logging of errors? > >> Can't think of any simple solution :( > > > Would this work ok in your case? > > > #define Singleton_Log(x) { static bool bSeen = false; \ > > if (bSeen == false) { bSeen = true; LogMessage(x) } } > > > No, not really. :( > > The problem is that I handle errors at one place, and I would like to > report many different errors and warnings, but only once each. > > > > b > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 > > |
From: Colin F. <cp...@ea...> - 2003-07-15 21:34:07
|
I like the idea of hashing error strings, collapsing identical error messages in to a single instance. Thus, the time stamp should not be part of the error text message; it should be stored along with the error, and should be "printed" alongside the error text upon display and/or logging to a file. I like the idea of having flags associated with messages, such as priority, and basic nature. I think the error logging mechanism should have settings to allow filtering out messages based on priority. Also, the user should be able to control which kinds of messages are subject to "collapsing via hashing". If you do collapse any messages, for sure I think you should COUNT the number of collapsed incidents. I think it would be illuminating to see that an error message occurred exactly 706 times (perhaps the number of keystrokes, resource files, seconds elapsed, visible objects, etc), or just one time, or 1,000,000 times! Finally, I think you should store a run-length encoded vector of the error hash values. It should be possible for you to recover the temporal order of all error messages. I was considering allowing myself to suppress specific error messages from appearing on a console in my game, dynamically. I would type: "hide error 17", or simply right-click on the error and select "hide". Thus, the console would not be cluttered by future instances of "error 17". I suppose an upper limit on the log file / error log file size is a good idea, or some policy about what to do when a certain size is reached. I guess I haven't really run in to many situations in which the number of error / status messages has swamped me -- but I've heard of a single, persisting error condition (network down, out of disk space, out of memory, etc) leading to all available disk space being used to repeatedly log the same error. It is really ironic when the huge log file leads to errors that also need to be logged, thus leading to endless silly log messages. It's as nutty as an exception handler doing something ambitious, like launching a window to report the error, causing another out-of-memory exception! At that point your app is doubly-insane. --- Colin cp...@ea... |