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
Родитель 8211d94335
Коммит 45167dace5
3 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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