Bug 653844 - Remove ifdefs for PR_LOGGING if not needed. r=mak

This commit is contained in:
Philipp Böhnke 2013-11-15 21:46:36 -05:00
parent d28dd6c55c
commit 019df31281
3 changed files with 0 additions and 21 deletions

View File

@ -138,10 +138,8 @@ AsyncStatement::initialize(Connection *aDBConnection,
mDBConnection = aDBConnection;
mSQLString = aSQLStatement;
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Inited async statement '%s' (0x%p)",
mSQLString.get()));
#endif
#ifdef DEBUG
// We want to try and test for LIKE and that consumers are using
@ -302,22 +300,17 @@ AsyncStatement::getAsyncStatement(sqlite3_stmt **_stmt)
if (!mAsyncStatement) {
int rc = mDBConnection->prepareStatement(mSQLString, &mAsyncStatement);
if (rc != SQLITE_OK) {
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_ERROR,
("Sqlite statement prepare error: %d '%s'", rc,
::sqlite3_errmsg(mDBConnection->GetNativeConnection())));
PR_LOG(gStorageLog, PR_LOG_ERROR,
("Statement was: '%s'", mSQLString.get()));
#endif
*_stmt = nullptr;
return rc;
}
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Initialized statement '%s' (0x%p)",
mSQLString.get(),
mAsyncStatement));
#endif
}
*_stmt = mAsyncStatement;
@ -369,10 +362,8 @@ AsyncStatement::Finalize()
mFinalized = true;
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Finalizing statement '%s'",
mSQLString.get()));
#endif
asyncFinalize();
cleanupJSHelpers();

View File

@ -990,9 +990,7 @@ Connection::prepareStatement(const nsCString &aSQL,
#ifdef DEBUG
NS_WARNING(warnMsg.get());
#endif
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_ERROR, ("%s", warnMsg.get()));
#endif
}
(void)::sqlite3_extended_result_codes(mDBConn, 0);

View File

@ -144,21 +144,17 @@ Statement::initialize(Connection *aDBConnection,
int srv = aDBConnection->prepareStatement(PromiseFlatCString(aSQLStatement),
&mDBStatement);
if (srv != SQLITE_OK) {
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_ERROR,
("Sqlite statement prepare error: %d '%s'", srv,
::sqlite3_errmsg(db)));
PR_LOG(gStorageLog, PR_LOG_ERROR,
("Statement was: '%s'", PromiseFlatCString(aSQLStatement).get()));
#endif
return NS_ERROR_FAILURE;
}
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Initialized statement '%s' (0x%p)",
PromiseFlatCString(aSQLStatement).get(),
mDBStatement));
#endif
mDBConnection = aDBConnection;
mParamCount = ::sqlite3_bind_parameter_count(mDBStatement);
@ -292,10 +288,8 @@ Statement::getAsyncStatement(sqlite3_stmt **_stmt)
return rc;
}
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_NOTICE,
("Cloned statement 0x%p to 0x%p", mDBStatement, mAsyncStatement));
#endif
}
*_stmt = mAsyncStatement;
@ -384,10 +378,8 @@ Statement::internalFinalize(bool aDestructing)
// In either case, the connection is still valid, hence closing
// here is safe.
//
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Finalizing statement '%s' during garbage-collection",
::sqlite3_sql(mDBStatement)));
#endif
srv = ::sqlite3_finalize(mDBStatement);
}
#ifdef DEBUG
@ -666,10 +658,8 @@ Statement::ExecuteStep(bool *_moreResults)
mExecuting = false;
}
else if (mExecuting) {
#ifdef PR_LOGGING
PR_LOG(gStorageLog, PR_LOG_ERROR,
("SQLite error after mExecuting was true!"));
#endif
mExecuting = false;
}