[persistence] added lrec_eflag_print() function for print eflag.
#include <string.h>
#include <ctype.h>
+#include <assert.h>
#include "default_engine.h"
#ifdef ENABLE_PERSISTENCE
@@ -155,6 +156,15 @@ static void lrec_bkey_print(uint8_t nbkey, unsigned char *bkey, char *str)
}
}
+static void lrec_eflag_print(uint8_t neflag, unsigned char *eflag, char *str)
+{
+ assert(neflag > 0);
+
+ char eflag_temp[MAX_EFLAG_LENG*2 + 2];
+ safe_hexatostr(eflag, neflag, eflag_temp);
+ sprintf(str, "len=%u val=0x%s", neflag, eflag_temp);
+}
+
/* Item Link Log Record */
/* KV : header | lrec_item_common | cas | key + value
* Collection : header | lrec_item_common | lrec_coll_meta | key + value(\r\n)
@@ -431,7 +441,7 @@ static void lrec_snapshot_elem_link_print(LogRec *logrec)
lrec_bkey_print(body->nekey, (unsigned char*)log->valptr, bkeystr + leng);
if (body->neflag != 0) {
leng = sprintf(eflagstr, " | eflag ");
- lrec_bkey_print(body->neflag, (unsigned char*)(log->valptr + BTREE_REAL_NBKEY(body->nekey)), eflagstr + leng);
+ lrec_eflag_print(body->neflag, (unsigned char*)(log->valptr + BTREE_REAL_NBKEY(body->nekey)), eflagstr + leng);
}
/* <key> <bkey> [<eflag>] <bytes> <data> */
