Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving trace to error log
Message
From
19/05/2009 08:29:38
 
 
To
18/05/2009 22:38:46
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01400554
Message ID:
01400588
Views:
39
>>Hi All:
>>
>>How can you save the program trace information in an error log table when writing to it in an error handler?
>
>Look at aStackInfo() - though, that will give you the stack only, not the last commands in the currently executing code. But at least you'll know how your code hit the error. Also list memory to a file, then filetostr() that file into a memo in your error log would help. You may try to strextract() your variables only - you don't need all the print system variables.
>
>You can get the exact lines from the coverage logger, but it writes to disk, writes too much stuff, and - worst of all - you have to start it in advance. IOW, before the error happens. It may work in development, but at runtime it's not that useful if there's nobody to read it.
>
>>Is saving the last 10 key presses as well too much to ask?
>
>If you're asking yourself, it isn't :). IOW, you'd have to add code to keypress method of just about every class you have, or to bindevent() it to your key logger object. It can have an array of 10 rows, and you could always ains() the new first row, and it would push the 11th row out. You'd only have to add the key logger in the init of your forms and toolbars classes, then recurse through all controls which may have a keypress method, then bindevent() their .keypress to a method of the keylogger. May even be fast enough that nobody would notice it.
>
>This still leaves you with no clue what did the user do with the menus and the mouse.

Thanks!
Previous
Reply
Map
View

Click here to load this message in the networking platform