You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
811 B

#pragma once
#include <iostream>
#include <string>
struct print {
print() {}
~print() { std::cout << std::endl; }
};
struct noprint {
noprint() { std::cout.setstate(std::ios_base::failbit); }
~noprint() { std::cout.clear(); }
};
#ifdef LOG_DEBUG
#define DEBUG (print(), std::cout << "DEBUG[" << __FILENAME__ << ":" << __LINE__ << " in " << __func__ << "()]: ")
#define WARN (print(), std::cout << "WARN [" << __FILENAME__ << ":" << __LINE__ << " in " << __func__ << "()]: ")
#else
#define DEBUG (noprint(), std::cout << "")
#define WARN (noprint(), std::cout << "")
#endif
#ifdef LOG_DEBUG
#define STEP \
do { DEBUG << "Stepping through, Hit Enter..."; \
std::cin.get(); \
} while (0)
#else
#define STEP (void)(0)
#endif
namespace io {
void debug(std::string msg);
}