git-svn-id: https://bucket.mit.edu/svn/nilm/acquisition/ethstream@9487 ddd99763-3ecb-0310-9145-efcb8ce7c51f
		
			
				
	
	
		
			43 lines
		
	
	
		
			943 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			943 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Labjack Tools
 | 
						|
 * Copyright (c) 2003-2007 Jim Paris <jim@jtan.com>
 | 
						|
 *
 | 
						|
 * This is free software; you can redistribute it and/or modify it and
 | 
						|
 * it is provided under the terms of version 2 of the GNU General Public
 | 
						|
 * License as published by the Free Software Foundation; see COPYING.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef DEBUG_H
 | 
						|
#define DEBUG_H
 | 
						|
 | 
						|
extern int verb_count;
 | 
						|
 | 
						|
#include <stdio.h>
 | 
						|
 | 
						|
int func_fprintf(const char *func, FILE * stream, const char *format,
 | 
						|
		 ...) __attribute__ ((format(printf, 3, 4)));
 | 
						|
int my_fprintf(FILE * stream, const char *format,
 | 
						|
	       ...) __attribute__ ((format(printf, 2, 3)));
 | 
						|
 | 
						|
#define debug(x...) ({ \
 | 
						|
	if(verb_count >= 2) \
 | 
						|
		func_fprintf(__func__, stderr,x); \
 | 
						|
})
 | 
						|
 | 
						|
#define verb(x...) ({ \
 | 
						|
	if(verb_count >= 1) \
 | 
						|
		func_fprintf(__func__, stderr,x); \
 | 
						|
})
 | 
						|
 | 
						|
#define info(x...) ({ \
 | 
						|
	if(verb_count >= 0) \
 | 
						|
		my_fprintf(stderr,x); \
 | 
						|
})
 | 
						|
 | 
						|
#define info_no_timestamp(x...) ({ \
 | 
						|
	if(verb_count >= 0) \
 | 
						|
		fprintf(stderr,x); \
 | 
						|
})
 | 
						|
 | 
						|
#endif
 |