diff --git a/config.c b/config.c index 88fec32..c239b4c 100644 --- a/config.c +++ b/config.c @@ -157,6 +157,9 @@ int read_config(void) else if (!strcmp(key, "full-logs")) { g_config.full_logs = value[0] == '1'; } + else if (!strcmp(key, "force-flush")) { + g_config.force_flush = value[0] == '1'; + } else if (!strcmp(key, "terminate-event")) { strncpy(g_config.terminate_event_name, value, ARRAYSIZE(g_config.terminate_event_name)); diff --git a/config.h b/config.h index 99f0711..cac529c 100644 --- a/config.h +++ b/config.h @@ -76,6 +76,9 @@ struct _g_config { // do we force sleep-skipping despite threads? int force_sleepskip; + // do we force flushing of each log? + int force_flush; + // server ip and port //unsigned int host_ip; //unsigned short host_port; diff --git a/log.c b/log.c index 82f6d86..512eefc 100644 --- a/log.c +++ b/log.c @@ -891,7 +891,8 @@ void loq(int index, const char *category, const char *name, free(lastlog.buf); lastlog.buf = NULL; // flush logs once we're done seeing duplicates of a particular API - //log_flush(); + if (g_config.force_flush) + log_flush(); } } if (lastlog.buf == NULL) {