Skip to content

Commit 53ca421

Browse files
committed
ui: print proper exception trace from log viewer
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 32778d1 commit 53ca421

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import android.text.Spannable
1919
import android.text.SpannableString
2020
import android.text.style.ForegroundColorSpan
2121
import android.text.style.StyleSpan
22+
import android.util.Log
2223
import android.view.LayoutInflater
2324
import android.view.Menu
2425
import android.view.MenuItem
@@ -177,7 +178,7 @@ class LogViewerActivity : AppCompatActivity() {
177178
process = try {
178179
builder.start()
179180
} catch (e: IOException) {
180-
e.printStackTrace()
181+
Log.e(TAG, Log.getStackTraceString(e))
181182
return@withContext
182183
}
183184
val stdout = BufferedReader(InputStreamReader(process!!.inputStream, StandardCharsets.UTF_8))
@@ -251,6 +252,7 @@ class LogViewerActivity : AppCompatActivity() {
251252
*/
252253
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*: (.*)$")
253254
private val LOGS: MutableMap<String, ByteArray> = ConcurrentHashMap()
255+
private const val TAG = "WireGuard/LogViewerActivity"
254256
}
255257

256258
private inner class LogEntryAdapter : RecyclerView.Adapter<LogEntryAdapter.ViewHolder>() {

0 commit comments

Comments
 (0)