It depends a lot on how you are doing logging. Firstly what system are you using for logging, eg. the Java logging API built into the JDK or something external like log4j? I am most familiar with the Java logging API. Also my familiarity with the Java logging API is configuring it from a configuration file, configuration from code may differ. In the simplest case it would be create another Logger in any class you want to use it, however depending on the configuration it may be more complicated to get it to do what you want.
I will try and get a look at what you are doing at some point, may be today but I cannot guarantee as I need to get on with my university work.
If you could give me hints on what you are doing for logging then that would make my task simpler, which logging API you are using, what configuration you are using, etc.
Michael Whapples-----Original Message----- From: John J. Boyer
Sent: Thursday, March 15, 2012 5:45 PM To: brailleblaster@xxxxxxxxxxxxxSubject: [brailleblaster] Re: Is it possible to show a stack trace in a dialog box?
Thanks. I have set up the logger, but it only reports problems that occur in BBIni. How do I get it to repoet problems in other classes? Perhaps an error message could offer the user the option of viewing the log. John On Thu, Mar 15, 2012 at 04:06:10PM -0000, Michael Whapples wrote:
Hello, Firstly I would say that in general stack traces should never be shown to users, stack traces probably are only really meaningful to developers. May be if there is an error message appear a details button may reveal debug information which may include a stack trace, however we should try and provide a more helpful message wherever possible to help users. An error dialog may offer a way to let the user send debug information todevelopers, but we probably would want more than just a stack trace, so maybe a section of the log output for just before the exception was raised could be sent as well. Anyway, to deal with the actual question, refer to the javadoc forException, which really doesn't add much over Throwable, so here's the linkfor Throwable's javadoc for Java6 http://docs.oracle.com/javase/6/docs/api/java/lang/Throwable.html If you were wanting to write to a stream of some sort then theprintStackTrace methods may be relevant as there are methods which can takePrintWriter or PrintStream. If you want greater programatic control/access to the stack trace then look at the method getStackTrace() which gets an array of the StackTraceElements, you would need to deal with StackTraceElement yourself to create the String in the form you want. Michael Whapples-----Original Message----- From: John J. BoyerSent: Thursday, March 15, 2012 12:01 PM To: brailleblaster@xxxxxxxxxxxxx Subject: [brailleblaster] Is it possible to show a stack trace in a dialog box? This would be a big help to development oif one is using the GUI and something bad happens. The trace would have to be captured as a String and then passed to a method in Documentmanager. This method would in turn display it in a SWT MessageBox with an OK button or perhaps with the option to continue. More generally. liblouis and liblouisutdml were designed to be their own developmennt tools. How can this be applied to BrailleBlaster? Thanks, John -- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities
-- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities