Freeciv-3.1
Loading...
Searching...
No Matches
Macros | Functions
ailog.h File Reference
#include "log.h"
#include "support.h"

Go to the source code of this file.

Macros

#define LOGLEVEL_TECH   LOG_DEBUG
 
#define TECH_LOG(ait, loglevel, 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)
 
void dai_unit_log (struct ai_type *ait, char *buffer, int buflength, const struct unit *punit)
 
void real_tech_log (struct ai_type *ait, const char *file, const char *function, int line, enum log_level level, bool send_notify, const struct player *pplayer, struct advance *padvance, const char *msg,...) fc__attribute((__format__(__printf__
 
void real_diplo_log (struct ai_type *ait, const char *file, const char *function, int line, enum log_level level, bool send_notify, const struct player *pplayer, const struct player *aplayer, const char *msg,...) fc__attribute((__format__(__printf__
 
void real_bodyguard_log (struct ai_type *ait, const char *file, const char *function, int line, enum log_level level, bool send_notify, const struct unit *punit, const char *msg,...) fc__attribute((__format__(__printf__
 

Macro Definition Documentation

◆ BODYGUARD_LOG

#define BODYGUARD_LOG (   ait,
  loglevel,
  punit,
  msg,
  ... 
)
Value:
{ \
bool send_notify = punit->server.debug; \
enum log_level level = (send_notify ? LOG_AI_TEST \
: MIN(loglevel, LOGLEVEL_BODYGUARD)); \
real_bodyguard_log(ait, __FILE__, __FUNCTION__, __FC_LINE__, level, \
send_notify, punit, \
msg, ## __VA_ARGS__); \
} \
}
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:73
#define __FC_LINE__
Definition log.h:40
#define log_do_output_for_level(level)
Definition log.h:89
log_level
Definition log.h:28
struct setting_list * level[OLEVELS_NUM]
Definition settings.c:183
#define MIN(x, y)
Definition shared.h:55
#define LOG_AI_TEST
Definition srv_log.h:38
#define LOGLEVEL_BODYGUARD
Definition srv_log.h:30
bool debug
Definition unit.h:231
struct unit::@80::@83 server

Definition at line 69 of file ailog.h.

◆ DIPLO_LOG

#define DIPLO_LOG (   ait,
  loglevel,
  pplayer,
  aplayer,
  msg,
  ... 
)
Value:
{ \
bool send_notify = BV_ISSET(pplayer->server.debug, PLAYER_DEBUG_DIPLOMACY); \
enum log_level level = (send_notify ? LOG_AI_TEST \
: MIN(loglevel, LOGLEVEL_PLAYER)); \
real_diplo_log(ait, __FILE__, __FUNCTION__, __FC_LINE__, level, \
send_notify, pplayer, aplayer, msg, ## __VA_ARGS__); \
} \
}
#define BV_ISSET(bv, bit)
Definition bitvector.h:78
@ PLAYER_DEBUG_DIPLOMACY
Definition player.h:217
#define LOGLEVEL_PLAYER
Definition srv_log.h:36

Definition at line 53 of file ailog.h.

◆ LOGLEVEL_TECH

#define LOGLEVEL_TECH   LOG_DEBUG

Definition at line 22 of file ailog.h.

◆ TECH_LOG

#define TECH_LOG (   ait,
  loglevel,
  pplayer,
  padvance,
  msg,
  ... 
)
Value:
{ \
bool send_notify = BV_ISSET(pplayer->server.debug, PLAYER_DEBUG_TECH); \
enum log_level level = (send_notify ? LOG_AI_TEST \
: MIN(loglevel, LOGLEVEL_TECH)); \
real_tech_log(ait, __FILE__, __FUNCTION__, __FC_LINE__, level, \
send_notify, pplayer, padvance, msg, ## __VA_ARGS__); \
} \
}
#define LOGLEVEL_TECH
Definition ailog.h:22
@ PLAYER_DEBUG_TECH
Definition player.h:217

Definition at line 36 of file ailog.h.

Function Documentation

◆ 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 40 of file ailog.c.

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 53 of file ailog.c.

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

◆ real_bodyguard_log()

void real_bodyguard_log ( struct ai_type ait,
const char *  file,
const char *  function,
int  line,
enum log_level  level,
bool  send_notify,
const struct unit punit,
const char *  msg,
  ... 
)

◆ real_diplo_log()

void real_diplo_log ( struct ai_type ait,
const char *  file,
const char *  function,
int  line,
enum log_level  level,
bool  send_notify,
const struct player pplayer,
const struct player aplayer,
const char *  msg,
  ... 
)

◆ real_tech_log()

void real_tech_log ( struct ai_type ait,
const char *  file,
const char *  function,
int  line,
enum log_level  level,
bool  send_notify,
const struct player pplayer,
struct advance padvance,
const char *  msg,
  ... 
)