diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index ce6da0e3e..8b75dbe87 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -1702,7 +1702,7 @@ public class GamesListDelegate extends ListDelegateBase case R.id.games_menu_clearLogStorage: makeConfirmThenBuilder( R.string.logstore_clear_confirm, Action.CLEAR_LOG_DB ) - .setPosButton( R.string.button_delete ) + .setPosButton( R.string.loc_item_clear ) .show(); break; case R.id.games_menu_dumpLogStorage: diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Log.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Log.java index 146e280f6..833443578 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Log.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Log.java @@ -26,6 +26,7 @@ import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.os.Environment; +import android.os.Process; import java.io.File; import java.io.FileOutputStream; @@ -242,11 +243,13 @@ public class Log { void store( LOG_LEVEL level, String tag, String msg ) { - long tid = Thread.currentThread().getId(); + int tid = Process.myTid(); + int pid = Process.myPid(); ContentValues values = new ContentValues(); values.put( COL_ENTRY, msg ); values.put( COL_THREAD, tid ); + values.put( COL_PID, pid ); values.put( COL_TAG, tag ); values.put( COL_LEVEL, level.ordinal() ); long res = getWritableDatabase().insert( LOGS_TABLE_NAME, null, values ); @@ -262,7 +265,7 @@ public class Log { OutputStream os = new FileOutputStream( db ); OutputStreamWriter osw = new OutputStreamWriter(os); - String[] columns = { COL_ENTRY, COL_TAG, COL_THREAD }; + String[] columns = { COL_ENTRY, COL_TAG, COL_THREAD, COL_PID }; String selection = null; String orderBy = COL_ROWID; Cursor cursor = getReadableDatabase().query( LOGS_TABLE_NAME, columns, @@ -272,12 +275,14 @@ public class Log { int indx0 = cursor.getColumnIndex( columns[0] ); int indx1 = cursor.getColumnIndex( columns[1] ); int indx2 = cursor.getColumnIndex( columns[2] ); + int indx3 = cursor.getColumnIndex( columns[3] ); while ( cursor.moveToNext() ) { String data = cursor.getString(indx0); String tag = cursor.getString(indx1); - long tid = cursor.getLong(indx2); + int tid = cursor.getInt(indx2); + int pid = cursor.getInt(indx3); StringBuilder builder = new StringBuilder() - .append(tid).append(":") + .append(String.format("% 5d % 5d", pid, tid)).append(":") .append(tag).append(":") .append(data).append("\n") ;