Freeciv21
Develop your civilization from humble roots to a global empire
ailog.h File Reference
#include "support.h"
#include "tech.h"
#include <QLoggingCategory>
+ Include dependency graph for ailog.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TECH_LOG(ait, _, pplayer, padvance, msg, ...)
 
#define DIPLO_LOG(ait, loglevel, pplayer, aplayer, msg, ...)
 
#define BODYGUARD_LOG(ait, loglevel, punit, msg, ...)
 

Functions

void dai_city_log (struct ai_type *ait, char *buffer, int buflength, const struct city *pcity)
 Produce logline fragment for srv_log. More...
 
void dai_unit_log (struct ai_type *ait, char *buffer, int buflength, const struct unit *punit)
 Produce logline fragment for srv_log. More...
 
QString tech_log_prefix (ai_type *ait, const player *pplayer, advance *padvance)
 Log player tech messages. More...
 
QString diplo_log_prefix (ai_type *ait, const player *pplayer, const player *aplayer)
 Log player messages, they will appear like this. More...
 
QString bodyguard_log_prefix (ai_type *ait, const unit *punit)
 Log message for bodyguards. More...
 

Macro Definition Documentation

◆ BODYGUARD_LOG

#define BODYGUARD_LOG (   ait,
  loglevel,
  punit,
  msg,
  ... 
)
Value:
{ \
bool notify = punit->server.debug; \
QString message = bodyguard_log_prefix(ait, punit) \
+ QStringLiteral(" ") \
+ QString::asprintf(msg, ##__VA_ARGS__); \
if (notify) { \
qCInfo(ai_category).noquote() << message; \
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", \
qUtf8Printable(message)); \
} else { \
qCDebug(ai_category).noquote() << message; \
} \
}
QString bodyguard_log_prefix(ai_type *ait, const unit *punit)
Log message for bodyguards.
Definition: ailog.cpp:98
const struct ft_color ftc_log

Definition at line 65 of file ailog.h.

◆ DIPLO_LOG

#define DIPLO_LOG (   ait,
  loglevel,
  pplayer,
  aplayer,
  msg,
  ... 
)
Value:
{ \
bool notify = BV_ISSET(pplayer->server.debug, PLAYER_DEBUG_DIPLOMACY); \
QString message = diplo_log_prefix(ait, pplayer, aplayer) \
+ QStringLiteral(" ") \
+ QString::asprintf(msg, ##__VA_ARGS__); \
if (notify) { \
qCInfo(ai_category).noquote() << message; \
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", \
qUtf8Printable(message)); \
} else { \
qCDebug(ai_category).noquote() << message; \
} \
}
QString diplo_log_prefix(ai_type *ait, const player *pplayer, const player *aplayer)
Log player messages, they will appear like this.
Definition: ailog.cpp:78
bool BV_ISSET(const BV &bv, int bit)
Definition: bitvector.h:37
@ PLAYER_DEBUG_DIPLOMACY
Definition: player.h:209

Definition at line 49 of file ailog.h.

◆ TECH_LOG

#define TECH_LOG (   ait,
  _,
  pplayer,
  padvance,
  msg,
  ... 
)
Value:
{ \
bool notify = BV_ISSET(pplayer->server.debug, PLAYER_DEBUG_TECH); \
QString message = tech_log_prefix(ait, pplayer, padvance) \
+ QStringLiteral(" ") \
+ QString::asprintf(msg, ##__VA_ARGS__); \
if (notify) { \
qCInfo(ai_category).noquote() << message; \
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", \
qUtf8Printable(message)); \
} else { \
qCDebug(ai_category).noquote() << message; \
} \
}
QString tech_log_prefix(ai_type *ait, const player *pplayer, advance *padvance)
Log player tech messages.
Definition: ailog.cpp:56
@ PLAYER_DEBUG_TECH
Definition: player.h:210

Definition at line 32 of file ailog.h.

Function Documentation

◆ bodyguard_log_prefix()

QString bodyguard_log_prefix ( ai_type ait,
const unit punit 
)

Log message for bodyguards.

They will appear like this Polish Mech. Inf.[485] bodyguard (38,22){Riflemen:574@37,23} note that these messages are likely to wrap if long.

Definition at line 98 of file ailog.cpp.

◆ dai_city_log()

void dai_city_log ( struct ai_type ait,
char *  buffer,
int  buflength,
const struct city pcity 
)

Produce logline fragment for srv_log.

Definition at line 32 of file ailog.cpp.

Referenced by cai_city_log(), texwai_city_log(), and twai_city_log().

◆ dai_unit_log()

void dai_unit_log ( struct ai_type ait,
char *  buffer,
int  buflength,
const struct unit punit 
)

Produce logline fragment for srv_log.

Definition at line 44 of file ailog.cpp.

Referenced by cai_unit_log(), texwai_unit_log(), and twai_unit_log().

◆ diplo_log_prefix()

QString diplo_log_prefix ( ai_type ait,
const player pplayer,
const player aplayer 
)

Log player messages, they will appear like this.

where ti is timer, co countdown and lo love for target, who is e.

Definition at line 78 of file ailog.cpp.

◆ tech_log_prefix()

QString tech_log_prefix ( ai_type ait,
const player pplayer,
advance padvance 
)

Log player tech messages.

Definition at line 56 of file ailog.cpp.