Commit 4dd5ac65 authored by Salvador Guerrero's avatar Salvador Guerrero Committed by Commit Bot

[leveldb_proto] Disabled warning log when database file not found

leveldb_database.cc used to log all initialization errors, including a
case we considered normal. When a database file is missing, and the
client set create_if_missing = false then this means the client expected
the file to be missing.

Our DB code attempts to open the shared database. As no client has
migrated to it then it's fine if it doesn't exist. However, as this code
get executed when BrowserContext starts then it spams the logs on
BrowserTests.

This CL removes logging for this specific case, as it is an expected
state which doesn't have to be logged.

Change-Id: I51a986b43b13c441384a7cf67df6565a64881941
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1670361
Commit-Queue: Salvador Guerrero <salg@google.com>
Auto-Submit: Salvador Guerrero <salg@google.com>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673411}
parent 9a91e292
...@@ -102,7 +102,11 @@ leveldb::Status LevelDB::Init(const base::FilePath& database_dir, ...@@ -102,7 +102,11 @@ leveldb::Status LevelDB::Init(const base::FilePath& database_dir,
leveldb_chrome::GetSharedBrowserBlockCache()->TotalCharge()); leveldb_chrome::GetSharedBrowserBlockCache()->TotalCharge());
} }
} }
} else { // Don't log warnings when result is InvalidArgument and create_if_missing
// is false, as this means the DB file doesn't exist and the client didn't
// ask to create a new one.
} else if (!(status.IsInvalidArgument() &&
!open_options_.create_if_missing)) {
LOG(WARNING) << "Unable to open " << database_dir.value() << ": " LOG(WARNING) << "Unable to open " << database_dir.value() << ": "
<< status.ToString(); << status.ToString();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment