Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push create/update table start/end logging into respective methods #14

Closed
peterschwarz opened this issue Apr 29, 2013 · 1 comment
Closed

Comments

@peterschwarz
Copy link

Currently, the logging for table create/update is generated like so:

    if (ACTIVATE_ALL_LOGS) {
        Log.d(LOG_TAG, "MyTable | createTable start");
    }
    MyTable.createTable(db);
    if (ACTIVATE_ALL_LOGS) {
        Log.d(LOG_TAG, "MyTable | createTable end");
    }

If one has a number of tables, this begins to look very cluttered in the source. It might be better to have this logging pushed into the beginning and end of the createTable method (and the updateTable methods as well).

E.g.

public static void createTable(SQLiteDatabase db) {
    if (ACTIVATE_ALL_LOGS) {
        Log.d(LOG_TAG, "MyTable | createTable start");
    }
    db.execSQL("CREATE TABLE " + TABLE_NAME + " (" +
                    Columns.ID.getName() + " " + Columns.ID.getType()+ ", " +
                    Columns.NAME.getName() + " " + Columns.NAME.getType() + ", " +
    ");");
    if (ACTIVATE_ALL_LOGS) {
        Log.d(LOG_TAG, "MyTable | createTable end");
    }
}
@foxykeep
Copy link
Owner

Hmm good point. Modifying that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants