13
How can I display the whole exception error code (Fullstacktrace) in Android Log?
try {
//CODE
}catch (Exception e){
Log.e(TAG,e.getStackTrace());
}
13
How can I display the whole exception error code (Fullstacktrace) in Android Log?
try {
//CODE
}catch (Exception e){
Log.e(TAG,e.getStackTrace());
}
14
I found a very practical way that I honestly didn’t know could be done like this.
try {
//CODE
}catch (Exception e){
Log.e(TAG, "Seu erro: ", e);
}
2
You can use it as follows:
try {
//CODE
} catch (Exception e) {
Log.e(TAG, "log de erro: ", e.getMessage());
Log.v(TAG, "log de verbose: ", e.getMessage());
Log.d(TAG, "log de debug: ", e.getMessage());
Log.i(TAG, "log de info: ", e.getMessage());
Log.w(TAG, "log de alerta: ", e.getMessage());
}
or
Log.e(TAG, "log de erro: ",new RuntimeException("TAG meu erro"));
2
I wear it like this:
Log.e("TAG", Log.getStackTraceString(e));
Browser other questions tagged java android exception log stack-trace
You are not signed in. Login or sign up in order to post.
Simply log in the exception and no relaunch it can leave the application in an indefinite state.
– Jordão
@Luiz Carvalho your answer was very useful, if you can mark it as accepted
√
, so when other users view your question they see that you already have a correct answer and accept it for you.– iTSangar
Done @iTSangar :D
– Luiz Carvalho