#pragma once
#include <stdio.h>

/* We'll use asserts in DEBUG if defined. */
#ifndef DEBUG
#  define NODEBUG
#endif /* DEBUG */
#include <assert.h>

#define LOG(str, args...)(fprintf(stdout, str"\n", ## args))
#ifdef DEBUG_PARANOID /* Will cause WARN's to blow up. */
#define WARN(str, args...)(fprintf(stderr, "Warning: "str"\n", ## args), assert(0))
#else
#define WARN(str, args...)(fprintf(stderr, "Warning: "str"\n", ## args))
#endif

#define ERR(str, args...) (fprintf(stderr, "ERROR %s:%d: [%s] "str"\n", \
  __FILE__, __LINE__, __func__, ## args), assert(0))

#ifdef DEBUG
#  undef DEBUG
#  define DEBUG(str, args...) LOG(str, ## args)
#  define DEBUGGING
#else
#  define DEBUG(str, args...) do {;} while(0)
#endif

