Fix binlog_dump

GitOrigin-RevId: bde918c7bd6a8be585d0a9a174a966709ca16474
This commit is contained in:
Arseny Smirnov 2019-06-13 15:53:10 +03:00
parent e59c88b22d
commit 53ce0a1ebb

View File

@ -28,18 +28,18 @@ int main(int argc, char *argv[]) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
td::Binlog binlog; td::Binlog binlog;
binlog binlog
.init(argv[1], .init(
argv[1],
[&](auto &event) { [&](auto &event) {
info[0].compressed_size += event.raw_event_.size(); info[0].compressed_size += event.raw_event_.size();
info[event.type_].compressed_size += event.raw_event_.size(); info[event.type_].compressed_size += event.raw_event_.size();
}, },
td::DbKey::empty(), td::DbKey::empty(), -1, td::DbKey::raw_key("cucumber"), td::DbKey::empty(), -1,
[&](auto &event) mutable { [&](auto &event) mutable {
info[0].full_size += event.raw_event_.size(); info[0].full_size += event.raw_event_.size();
info[event.type_].full_size += event.raw_event_.size(); info[event.type_].full_size += event.raw_event_.size();
LOG(PLAIN) << "LogEvent[" << td::tag("id", td::format::as_hex(event.id_)) << td::tag("type", event.type_) LOG(PLAIN) << "LogEvent[" << td::tag("id", td::format::as_hex(event.id_)) << td::tag("type", event.type_)
<< td::tag("flags", event.flags_) << td::tag("data", td::format::escaped(event.data_)) << td::tag("flags", event.flags_) << td::tag("data", td::format::escaped(event.data_)) << "]\n";
<< "]\n";
}) })
.ensure(); .ensure();