mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx-test: add log_pair()
(minor).
Change-Id: Ifdb762e79b14df0608b5b298941114ada4bc0095
This commit is contained in:
parent
31857210c5
commit
73c2e5355f
@ -187,13 +187,7 @@ void __hot maker::pair(serial_t serial, const buffer &key, buffer &value,
|
||||
|
||||
mk_continue(key_serial, key_essentials, *key);
|
||||
mk_continue(value_serial, value_essentials, *value);
|
||||
|
||||
if (log_enabled(logging::trace)) {
|
||||
char dump_key[4096], dump_value[4096];
|
||||
log_trace("keygen-pair: key %s, value %s",
|
||||
mdbx_dump_val(&key->value, dump_key, sizeof(dump_key)),
|
||||
mdbx_dump_val(&value->value, dump_value, sizeof(dump_value)));
|
||||
}
|
||||
log_pair(logging::trace, "kv", key, value);
|
||||
}
|
||||
|
||||
void maker::setup(const config::actor_params_pod &actor, unsigned actor_id,
|
||||
@ -368,4 +362,15 @@ void __hot maker::mk_continue(const serial_t serial, const essentials ¶ms,
|
||||
out.bytes + out.limit);
|
||||
}
|
||||
|
||||
void log_pair(logging::loglevel level, const char *prefix, const buffer &key,
|
||||
buffer &value) {
|
||||
if (log_enabled(level)) {
|
||||
char dump_key[4096], dump_value[4096];
|
||||
logging::output(
|
||||
level, "%s-pair: key %s, value %s", prefix,
|
||||
mdbx_dump_val(&key->value, dump_key, sizeof(dump_key)),
|
||||
mdbx_dump_val(&value->value, dump_value, sizeof(dump_value)));
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace keygen */
|
||||
|
@ -133,4 +133,7 @@ public:
|
||||
bool increment(serial_t &serial, int delta) const;
|
||||
};
|
||||
|
||||
void log_pair(logging::loglevel level, const char *prefix, const buffer &key,
|
||||
buffer &value);
|
||||
|
||||
} /* namespace keygen */
|
||||
|
Loading…
Reference in New Issue
Block a user