Is there a way to print my sqlite query to logCat? Here is my query
db.query(TABLE, projection, selection, selectionArgs, null, null, null)
You can Try to add
adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
For ormlite
adb shell setprop log.tag.StatementExecutor VERBOSE
adb shell setprop log.tag.BaseMappedStatement VERBOSE
adb shell setprop log.tag.MappedCreate VERBOSE
adb shell setprop log.tag.ORMLite DEBUG
You may need to restart Android Studio.
Edit 1: I test sqllite on Mobile, the configs seem useless.I don't know the reason. It doesn't work as the source code say:
public final class SQLiteDebug {
private static native void nativeGetPagerStats(PagerStats stats);
/**
* Controls the printing of informational SQL log messages.
*
* Enable using "adb shell setprop log.tag.SQLiteLog VERBOSE".
*/
public static final boolean DEBUG_SQL_LOG =
Log.isLoggable("SQLiteLog", Log.VERBOSE);
/**
* Controls the printing of SQL statements as they are executed.
*
* Enable using "adb shell setprop log.tag.SQLiteStatements VERBOSE".
*/
public static final boolean DEBUG_SQL_STATEMENTS =
Log.isLoggable("SQLiteStatements", Log.VERBOSE);
/**
* Controls the printing of wall-clock time taken to execute SQL statements
* as they are executed.
*
* Enable using "adb shell setprop log.tag.SQLiteTime VERBOSE".
*/
public static final boolean DEBUG_SQL_TIME =
Log.isLoggable("SQLiteTime", Log.VERBOSE);
/**
* True to enable database performance testing instrumentation.
* @hide
*/
public static final boolean DEBUG_LOG_SLOW_QUERIES = Build.IS_DEBUGGABLE;
private SQLiteDebug() {
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With