From 53ca421a85fd6712ae5099ae8817a8954a63261a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 26 Sep 2020 12:01:58 +0200 Subject: ui: print proper exception trace from log viewer Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/src/main') diff --git a/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt b/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt index eeabe4d1..d343bd87 100644 --- a/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt +++ b/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt @@ -19,6 +19,7 @@ import android.text.Spannable import android.text.SpannableString import android.text.style.ForegroundColorSpan import android.text.style.StyleSpan +import android.util.Log import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem @@ -177,7 +178,7 @@ class LogViewerActivity : AppCompatActivity() { process = try { builder.start() } catch (e: IOException) { - e.printStackTrace() + Log.e(TAG, Log.getStackTraceString(e)) return@withContext } val stdout = BufferedReader(InputStreamReader(process!!.inputStream, StandardCharsets.UTF_8)) @@ -251,6 +252,7 @@ class LogViewerActivity : AppCompatActivity() { */ private val THREADTIME_LINE: Pattern = Pattern.compile("^(\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d{3})(?:\\s+[0-9A-Za-z]+)?\\s+(\\d+)\\s+(\\d+)\\s+([A-Z])\\s+(.+?)\\s*: (.*)$") private val LOGS: MutableMap = ConcurrentHashMap() + private const val TAG = "WireGuard/LogViewerActivity" } private inner class LogEntryAdapter : RecyclerView.Adapter() { -- cgit v1.2.3