зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1126129 - Only enable SQLite tracing when the right environment variable is set, r=asuth.
This commit is contained in:
Родитель
1ac680d086
Коммит
afaefae6c7
|
@ -647,13 +647,17 @@ Connection::initializeInternal(nsIFile* aDatabaseFile)
|
||||||
if (!gStorageLog)
|
if (!gStorageLog)
|
||||||
gStorageLog = ::PR_NewLogModule("mozStorage");
|
gStorageLog = ::PR_NewLogModule("mozStorage");
|
||||||
|
|
||||||
::sqlite3_trace(mDBConn, tracefunc, this);
|
// SQLite tracing can slow down queries (especially long queries)
|
||||||
|
// significantly. Don't trace unless the user is actively monitoring SQLite.
|
||||||
|
if (PR_LOG_TEST(gStorageLog, PR_LOG_DEBUG)) {
|
||||||
|
::sqlite3_trace(mDBConn, tracefunc, this);
|
||||||
|
|
||||||
nsAutoCString leafName(":memory");
|
nsAutoCString leafName(":memory");
|
||||||
if (aDatabaseFile)
|
if (aDatabaseFile)
|
||||||
(void)aDatabaseFile->GetNativeLeafName(leafName);
|
(void)aDatabaseFile->GetNativeLeafName(leafName);
|
||||||
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Opening connection to '%s' (%p)",
|
PR_LOG(gStorageLog, PR_LOG_NOTICE, ("Opening connection to '%s' (%p)",
|
||||||
leafName.get(), this));
|
leafName.get(), this));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int64_t pageSize = Service::getDefaultPageSize();
|
int64_t pageSize = Service::getDefaultPageSize();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче