android - stack trace and variable values -


is possible variable values included in stack trace? have started using bugsense emails stacktrace me , wonder if there way in code put variable values stacktrace output

not default, have yourself:

the stack trace tell involved line of code (where exception thrown) , execution stack.

but nothing prevents catching exception , include debug information in message:

try {    ...the code... } catch (throwable t) {    // here, catch throwable (exception error such outofmemory     // or noclassdeffound), *absolutely not suitable*     // else debugging.    // can (should, actually) make catch statement more specific     // depending of exception or error facing     // dump variables here:    final string message = "myvar=" + myvar;      // statement below rethrows original throwable , adds    // own message    throw new runtimeexception(message, t);  } 

or put breakpoint in catch { } statement inspect state of application @ stage, understood may not applicable in case describing.

(by way, suggest add tag "java" question. way visible java community of stackoverflow)


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -