obidebug.h 871 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 * Header file for the debugging code                                       *
 ****************************************************************************/

/**
 * @file obidebug.h
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 * @date 25 June 2015
 * @brief Header file for the debugging code.
10 11 12 13 14 15 16 17 18
 */


#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <limits.h>


19
//#ifndef DEBUG_LEVEL			// TODO
20 21 22 23 24 25 26 27 28 29 30 31 32 33
//#define DEBUG_LEVEL MAXINT
//#endif


//#ifdef OBIDEBUG
#define obidebug(debug_level, message, ...) \
	{if (debug_level > DEBUG_LEVEL) \
		{fprintf(stderr, "DEBUG %s:%d:%s, obi_errno = %d, errno = %d : " \
				message "\n", __FILE__, __LINE__, __func__, obi_errno, errno, ##__VA_ARGS__); \
		} \
	}
//#else
//#define obidebug(debug_level, message, ...)
//#endif