Breadcrumb for database info

pull/194/merge
M66B 3 years ago
parent 59a5ef65d9
commit ad73df35eb

@ -35,6 +35,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@ -403,9 +404,10 @@ public abstract class DB extends RoomDatabase {
.addCallback(new Callback() { .addCallback(new Callback() {
@Override @Override
public void onOpen(@NonNull SupportSQLiteDatabase db) { public void onOpen(@NonNull SupportSQLiteDatabase db) {
Log.i("Database" + Map<String, String> map = new HashMap<>();
" version=" + db.getVersion() + map.put("version", Integer.toString(db.getVersion()));
" WAL=" + db.isWriteAheadLoggingEnabled()); map.put("WAL", Boolean.toString(db.isWriteAheadLoggingEnabled()));
Log.breadcrumb("Database", map);
// https://www.sqlite.org/pragma.html#pragma_cache_size // https://www.sqlite.org/pragma.html#pragma_cache_size
Integer cache_size = getCacheSizeKb(context); Integer cache_size = getCacheSizeKb(context);

Loading…
Cancel
Save