Print name of user comparator in LOG.

Summary:
The current code prints the name of the InternalKeyComparator
in the log file. We would also like to print the name of the
user-specified comparator for easier debugging.

Test Plan: make check

Reviewers: sheki

Reviewed By: sheki

CC: leveldb

Differential Revision: https://reviews.facebook.net/D11181
This commit is contained in:
Dhruba Borthakur 2013-06-10 08:13:23 -07:00
parent a4913c5170
commit c5de1b9391

View File

@ -44,7 +44,8 @@ std::string InternalKey::DebugString(bool hex) const {
}
const char* InternalKeyComparator::Name() const {
return "leveldb.InternalKeyComparator";
return ("leveldb.InternalKeyComparator:" +
std::string(user_comparator_->Name())).c_str();
}
int InternalKeyComparator::Compare(const Slice& akey, const Slice& bkey) const {