Enable Estimator debug as a runtime option

It can be enables adding:
--debug-rules "gc.estimator.debug=true"
to the command line.
This commit is contained in:
Alejandro Martinez
2022-08-24 13:04:03 -03:00
parent 481e11fffc
commit a31ce926dc

View File

@@ -26,26 +26,13 @@
#include "Banister.h"
#ifndef ESTIMATOR_DEBUG
#define ESTIMATOR_DEBUG false
#endif
Q_DECLARE_LOGGING_CATEGORY(gcEstimator)
Q_LOGGING_CATEGORY(gcEstimator, "gc.estimator")
#ifdef Q_CC_MSVC
#define printd(fmt, ...) do { \
if (ESTIMATOR_DEBUG) { \
printf("[%s:%d %s] " fmt , __FILE__, __LINE__, \
__FUNCTION__, __VA_ARGS__); \
fflush(stdout); \
} \
} while(0)
#define printd(fmt, ...) qCDebug(gcEstimator, fmt, __VA_ARGS__);
#else
#define printd(fmt, args...) \
do { \
if (ESTIMATOR_DEBUG) { \
printf("[%s:%d %s] " fmt , __FILE__, __LINE__, \
__FUNCTION__, ##args); \
fflush(stdout); \
} \
} while(0)
#define printd(fmt, args...) qCDebug(gcEstimator, fmt, ##args);
#endif
class RollingBests {