diff --git a/storage/src/VacuumManager.cpp b/storage/src/VacuumManager.cpp index ab3055175873..1417dae1ce75 100644 --- a/storage/src/VacuumManager.cpp +++ b/storage/src/VacuumManager.cpp @@ -244,7 +244,7 @@ Vacuumer::HandleError(mozIStorageError *aError) NS_WARNING(warnMsg.get()); #endif - { + if (PR_LOG_TEST(gStorageLog, PR_LOG_ERROR)) { int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); diff --git a/storage/src/mozStorageConnection.cpp b/storage/src/mozStorageConnection.cpp index 743491bd7b87..89f4d05d6f69 100644 --- a/storage/src/mozStorageConnection.cpp +++ b/storage/src/mozStorageConnection.cpp @@ -897,11 +897,13 @@ Connection::internalClose(sqlite3 *aNativeConnection) } #endif // DEBUG - nsAutoCString leafName(":memory"); - if (mDatabaseFile) - (void)mDatabaseFile->GetNativeLeafName(leafName); - PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Closing connection to '%s'", - leafName.get())); + if (PR_LOG_TEST(gStorageLog, PR_LOG_NOTICE)) { + nsAutoCString leafName(":memory"); + if (mDatabaseFile) + (void)mDatabaseFile->GetNativeLeafName(leafName); + PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Closing connection to '%s'", + leafName.get())); + } // At this stage, we may still have statements that need to be // finalized. Attempt to close the database connection. This will diff --git a/storage/src/mozStorageStatement.cpp b/storage/src/mozStorageStatement.cpp index 22b0960a9679..9b6ea3a0b504 100644 --- a/storage/src/mozStorageStatement.cpp +++ b/storage/src/mozStorageStatement.cpp @@ -604,7 +604,7 @@ Statement::ExecuteStep(bool *_moreResults) } int srv = mDBConnection->stepStatement(mNativeConnection, mDBStatement); - if (srv != SQLITE_ROW && srv != SQLITE_DONE) { + if (srv != SQLITE_ROW && srv != SQLITE_DONE && PR_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) { nsAutoCString errStr; (void)mDBConnection->GetLastErrorString(errStr); PR_LOG(gStorageLog, PR_LOG_DEBUG,