diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-26 12:01:58 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-26 12:01:58 +0200 |
commit | 53ca421a85fd6712ae5099ae8817a8954a63261a (patch) | |
tree | 81769a3cf0829ccc36e647ef6097356ec0c0456c /ui/src/main/java/com/wireguard/android | |
parent | 32778d1c03807b658010e73a4483b61a0e89f7bf (diff) |
ui: print proper exception trace from log viewer
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt | 4 |
1 files changed, 3 insertions, 1 deletions
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<String, ByteArray> = ConcurrentHashMap() + private const val TAG = "WireGuard/LogViewerActivity" } private inner class LogEntryAdapter : RecyclerView.Adapter<LogEntryAdapter.ViewHolder>() { |