Skip to content
Snippets Groups Projects
debug.c 340 B
Newer Older
  • Learn to ignore specific revisions
  • Anjan Chanda's avatar
    Anjan Chanda committed
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdarg.h>
    
    #include "debug.h"
    
    void log_message(int level, const char *fmt, ...)
    {
    	va_list args;
    	int iop_debug;
    	char *e = getenv("IOP_LLA_LIBS_DEBUG");
    
    	iop_debug = e ? atoi(e) : -1;
    	if (iop_debug < level)
    		return;
    
    	va_start(args, fmt);
    	vfprintf(stderr, fmt, args);
    	va_end(args);
    }