Bug 1164559 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj

This commit is contained in:
Eric Rahm 2015-05-14 10:13:24 -07:00
parent 919620d653
commit 569c352964
3 changed files with 9 additions and 7 deletions

View File

@ -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);

View File

@ -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

View File

@ -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,