Initial work on benchmarks of other logging systems.

This commit is contained in:
Kevin M. Godby
2016-05-04 22:46:30 -05:00
parent 846fdf9f5c
commit 2132fe0ec5
11 changed files with 123 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
const char g_path[] = "logs/zf_log.txt";
static FILE *g_f;
static void output_callback(zf_log_message *msg)
static void output_callback(const zf_log_message* msg, void* arg)
{
*msg->p = '\n';
fwrite(msg->buf, msg->p - msg->buf + 1, 1, g_f);
@@ -18,7 +18,7 @@ int main(int, char* [])
ZF_LOGE_AUX(ZF_LOG_STDERR, "Failed to open log file: %s", g_path);
return -1;
}
zf_log_set_output_callback(ZF_LOG_PUT_STD, output_callback);
ZF_LOG_DEFINE_GLOBAL_OUTPUT = {ZF_LOG_PUT_STD, nullptr, &output_callback};
const int howmany = 1000000;
for(int i = 0 ; i < howmany; ++i)