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
Post a Comment