Best Way to Implement a Debug Screen
I have developed a few apps that work together. I have also created an OptionsProvider, under which I want the option to display a "debug" screen. This debug screen should contain messages sent by any of the other applications in my suite.
My first attempt at this did work (using a RunTime object (string) which I appended to every time). The problem is that when I run it the first time everything is good, but if I exit the debug screen then I can never access it again because I get an Exception.
Is there a bettery way to create such a debug screen?
I create debug screens that require a certain series of keystrokes to display. Similar to the display of RIM's log screen (ALT-L-G-L-G).
In my KeyListener, I check for ALT plus the keys and display my screen.
I have toyed with that idea, but it isn't really required for my application. In any event, the problem wasn't so much "how to access the screen", but rather, how to pass data from other applications.
Right now I am using a RuntimeStore object (a string) which I append to. The problem is that when I show the screen it does not get updated in realtime.
Other applications write to the debug screen by calling:
I have a working solution now, however I welcome recommendations...
I have created two RuntimeStore objects, one String to contain all the messages, and one RichTextField to indicate if the window is visible.
1) In the constructor for the display, I create the RTF object and populate it with the String contents.
2) In the onClose() function I remove the RTF from the RuntimeStore.
3) In the the DebugMessage function, I add the message to the String, and if the RTF object exists, then the window is created, so I add the new string to it. Otherwise, the debug window is not open so I don't need to worry.
I realize that this is pretty shabby coding, but it works. Any suggestions for improvement?
Is there a reason why you don't want to use the system log?
I suppose there isn't really a "good" reason why I don't just use the system log. However I want to provide the users with a "one-stop-shopping" location to go for the troubleshooting messages. Rather than have to tell them all "Hit Alt-LGLG and tell me what you see", I can have them access my debug menu from my options menu.
This is more intuitive to the user and I have more control over what they are seeing.
|All times are GMT -5. The time now is 07:15 PM.|
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.