13#define BLUE "\033[34m"
15#define CYAN "\033[36m"
16#define GREEN "\033[32m"
17#define MAGENTA "\033[35m"
19#define RESET "\033[0m"
20#define WHITE "\033[37m"
21#define YELLOW "\033[33m"
22#define FUNC_STYLE "\033[2m"
23#define ERROR_STYLE "\033[1m"
28#define FUNCTION_NAME ((__PRETTY_FUNCTION__) ? __PRETTY_FUNCTION__ : "UnknownFunction")
30#define FUNCTION_NAME ((__FUNCTION__) ? __FUNCTION__ : "UnknownFunction")
33#define FUNCTION_NAME "UnknownFunction"
51log(
int verbosityLevel,
const char* color,
const char* fmt...);
62logDebug(
int verbosityLevel,
const char* color,
const char* issuer,
const char* fmt...);
74logClause(
int verbosityLevel,
const char* color,
const int* lits,
unsigned int size,
const char* fmt...);
105extern std::atomic<bool>
quiet;
112#define LOG(level, ...) \
114 log(level, RESET, __VA_ARGS__); \
120#define LOGERROR(...) \
122 logDebug(0, RED, FUNCTION_NAME, __VA_ARGS__); \
128#define PABORT(EXIT_CODE, ...) \
130 logDebug(0, RED, FUNCTION_NAME, __VA_ARGS__); \
137#define LOGWARN(...) \
139 logDebug(0, YELLOW, FUNCTION_NAME, __VA_ARGS__); \
145#define LOGSTAT(...) \
147 log(0, GREEN, __VA_ARGS__); \
156 log(0, RESET, __VA_ARGS__); \
164 log(1, RESET, __VA_ARGS__); \
172 log(2, RESET, __VA_ARGS__); \
180 log(3, RESET, __VA_ARGS__); \
188 log(4, RESET, __VA_ARGS__); \
194#define LOGVECTOR(lits, size, ...) \
196 logClause(1, CYAN, lits, size, __VA_ARGS__); \
206#define LOGVECTOR(...)
213#define LOGDEBUG1(...) \
215 logDebug(1, BLUE, FUNCTION_NAME, __VA_ARGS__); \
221#define LOGDEBUG2(...) \
223 logDebug(2, MAGENTA, FUNCTION_NAME, __VA_ARGS__); \
229#define LOGDEBUG3(...) \
231 logDebug(4, MAGENTA, FUNCTION_NAME, __VA_ARGS__); \
237#define LOGCLAUSE1(lits, size, ...) \
239 logClause(2, CYAN, lits, size, __VA_ARGS__); \
245#define LOGCLAUSE2(lits, size, ...) \
247 logClause(5, CYAN, lits, size, __VA_ARGS__); \
252#define LOGDEBUG1(...)
253#define LOGDEBUG2(...)
254#define LOGDEBUG3(...)
255#define LOGCLAUSE1(...)
256#define LOGCLAUSE2(...)
void setVerbosityLevel(int level)
Set the verbosity level for logging.
std::atomic< bool > quiet
Global flag to enable/disable logging.
void log(int verbosityLevel, const char *color, const char *fmt...)
Log a message with a specified verbosity level and color.
void logModel(const std::vector< int > &model)
Log the model (satisfying assignment) found by the SAT solver.
void logDebug(int verbosityLevel, const char *color, const char *issuer, const char *fmt...)
Log a debug message with a specified verbosity level, color, and issuer.
void unlockLogger()
Release the logger mutex after logging.
void logClause(int verbosityLevel, const char *color, const int *lits, unsigned int size, const char *fmt...)
Log a clause with a specified verbosity level and color.
void lockLogger()
Acquire the logger mutex to ensure thread-safe logging.
void logSolution(const char *string)
Log the solution status of the SAT solver.