Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Demote "Unable to make space for entry" message from Warning to Debug #4708

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/default/mbgl/storage/offline_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ std::pair<bool, uint64_t> OfflineDatabase::putInternal(const Resource& resource,
}

if (evict_ && !evict(size)) {
Log::Warning(Event::Database, "Unable to make space for entry");
Log::Debug(Event::Database, "Unable to make space for entry");
return { false, 0 };
}

Expand Down
8 changes: 2 additions & 6 deletions test/storage/offline_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,17 +586,13 @@ TEST(OfflineDatabase, PutRegionResourceDoesNotEvict) {
TEST(OfflineDatabase, PutFailsWhenEvictionInsuffices) {
using namespace mbgl;

Log::setObserver(std::make_unique<FixtureLogObserver>());
OfflineDatabase db(":memory:", 1024 * 100);

Response big;
big.data = randomString(1024 * 100);
db.put(Resource::style("http://example.com/big"), big);
EXPECT_FALSE(bool(db.get(Resource::style("http://example.com/big"))));

auto observer = Log::removeObserver();
auto flo = dynamic_cast<FixtureLogObserver*>(observer.get());
EXPECT_EQ(1ul, flo->count({ EventSeverity::Warning, Event::Database, -1, "Unable to make space for entry" }));
EXPECT_FALSE(db.put(Resource::style("http://example.com/big"), big).first);
EXPECT_FALSE(bool(db.get(Resource::style("http://example.com/big"))));
}

TEST(OfflineDatabase, OfflineMapboxTileCount) {
Expand Down