Initial work on benchmarks of other logging systems.
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user