Add dumpBuffer() in libgourou_common

This commit is contained in:
2022-08-27 15:42:11 +02:00
parent 7084fb7025
commit 56b3231f92
3 changed files with 17 additions and 24 deletions

View File

@@ -415,6 +415,20 @@ namespace gourou
}
return 0;
}
static inline void dumpBuffer(GOUROU_LOG_LEVEL level, const char* title, const unsigned char* data, unsigned int len)
{
if (gourou::logLevel < level)
return;
printf("%s", title);
for(unsigned int i=0; i<len; i++)
{
if (i && !(i%16)) printf("\n");
printf("%02x ", data[i]);
}
printf("\n");
}
}
#endif