xerrlogHexPrintf ellipsis

This commit is contained in:
Michael Davidsaver
2021-08-30 13:52:05 -07:00
parent d811d5e17a
commit 2f122da5c2
+5
View File
@@ -256,6 +256,9 @@ Level logger::init()
void xerrlogHexPrintf(const void *buf, size_t buflen)
{
const auto cbuf = static_cast<const uint8_t*>(buf);
bool elipsis = buflen > 64u;
if(elipsis)
buflen = 64u;
// whole buffer
for(size_t pos=0; pos<buflen;)
@@ -286,6 +289,8 @@ void xerrlogHexPrintf(const void *buf, size_t buflen)
errlogPrintf("%04x : %s %s %s %s\n", addr, buf[0], buf[1], buf[2], buf[3]);
}
if(elipsis)
errlogPrintf("...\n");
}
void logger_level_set(const char *name, int lvl)