mirror of
https://github.com/moparisthebest/SSLDroid
synced 2024-11-23 09:22:16 -05:00
Polished log view a bit more
Signed-off-by: Balint Kovacs <blint@blint.hu>
This commit is contained in:
parent
3a03aa7eed
commit
2e55c4e2c3
@ -8,4 +8,4 @@
|
||||
# project structure.
|
||||
|
||||
# Project target.
|
||||
target=android-8
|
||||
target=android-7
|
||||
|
@ -1,11 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" android:isScrollContainer="true">
|
||||
<ScrollView android:id="@+id/scrollView1" android:layout_height="match_parent" android:layout_width="wrap_content">
|
||||
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent">
|
||||
<TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/logTextView" android:text="@string/reading_logs"></TextView>
|
||||
</LinearLayout>
|
||||
<ScrollView android:id="@+id/scrollView1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="none" android:editable="false" android:id="@+id/logTextView" android:text="@string/reading_logs"/>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
@ -16,26 +16,27 @@ public class SSLDroidReadLogs extends Activity{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.read_logs);
|
||||
TextView logcontainer = (TextView) findViewById(R.id.logTextView);
|
||||
logcontainer.setText("");
|
||||
Process mLogcatProc = null;
|
||||
BufferedReader reader = null;
|
||||
try
|
||||
{
|
||||
mLogcatProc = Runtime.getRuntime().exec(new String[]
|
||||
{"logcat", "-d", "SSLDroid:D SSLDroidGui:D *:S" });
|
||||
{"logcat", "-d", "-v", "time", "-b", "main", "SSLDroid:D SSLDroidGui:D *:S" });
|
||||
|
||||
reader = new BufferedReader(new InputStreamReader(mLogcatProc.getInputStream()));
|
||||
|
||||
String line;
|
||||
final StringBuilder log = new StringBuilder();
|
||||
//final StringBuilder log = new StringBuilder();
|
||||
String separator = System.getProperty("line.separator");
|
||||
|
||||
while ((line = reader.readLine()) != null)
|
||||
{
|
||||
log.append(line);
|
||||
log.append(separator);
|
||||
logcontainer.append(line);
|
||||
logcontainer.append(separator);
|
||||
}
|
||||
|
||||
logcontainer.setText(log);
|
||||
//logcontainer.setText(log);
|
||||
}
|
||||
|
||||
catch (IOException e)
|
||||
|
Loading…
Reference in New Issue
Block a user