32 #define LOGLEVEL_BODYGUARD LOG_DEBUG
33 #define LOGLEVEL_UNIT LOG_DEBUG
34 #define LOGLEVEL_GOTO LOG_DEBUG
35 #define LOGLEVEL_CITY LOG_DEBUG
36 #define LOGLEVEL_BUILD LOG_DEBUG
37 #define LOGLEVEL_HUNT LOG_DEBUG
38 #define LOGLEVEL_PLAYER LOG_DEBUG
40 #define LOG_AI_TEST LOG_NORMAL
80 #define CITY_LOG(_, pcity, msg, ...) \
82 bool notify = pcity->server.debug; \
83 QString message = city_log_prefix(pcity) + QStringLiteral(" ") \
84 + QString::asprintf(msg, ##__VA_ARGS__); \
86 qInfo().noquote() << message; \
87 notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", \
88 qUtf8Printable(message)); \
90 qDebug().noquote() << message; \
95 #define UNIT_LOG(_, punit, msg, ...) \
97 bool notify = punit->server.debug \
98 || (tile_city(unit_tile(punit)) \
99 && tile_city(unit_tile(punit))->server.debug); \
100 QString message = unit_log_prefix(punit) + QStringLiteral(" ") \
101 + QString::asprintf(msg, ##__VA_ARGS__); \
103 qInfo().noquote() << message; \
104 notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", \
105 qUtf8Printable(message)); \
107 qDebug().noquote() << message; \
118 #define TIMING_LOG(timer, activity) timing_log_real(timer, activity)
119 #define TIMING_RESULTS() timing_results_real()
121 #define TIMING_LOG(timer, activity)
122 #define TIMING_RESULTS()
void timing_log_init()
Initialize AI timing system.
void timing_log_free()
Free AI timing system resources.
QString unit_log_prefix(const unit *punit)
Log a unit, it will appear like this Polish Archers[139] (5,35)->(0,0){0,0} where [] is unit id,...
QString city_log_prefix(const city *pcity)
Log a city, it will appear like this Polish Romenna(5,35) [s1 d106 u11 g1].
void timing_log_real(enum ai_timer timer, enum ai_timer_activity activity)
Measure the time between the calls.
void timing_results_real()
Print results.