Freeciv-3.3: /fast/freeciv/nightly/main/ai/default/dailog.h File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Macros | Functions
dailog.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)); \
if (log_do_output_for_level(level)) { \
real_bodyguard_log(ait, __FILE__, __FUNCTION__, __FC_LINE__, level, \
send_notify, punit, \
msg, ## __VA_ARGS__); \
} \
}
incite_cost
char * incite_cost
Definition comments.c:74
punit
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:74
__FC_LINE__
#define __FC_LINE__
Definition log.h:40
log_do_output_for_level
#define log_do_output_for_level(level)
Definition log.h:89
log_level
log_level
Definition log.h:28
level
struct setting_list * level[OLEVELS_NUM]
Definition settings.c:190
MIN
#define MIN(x, y)
Definition shared.h:55
LOG_AI_TEST
#define LOG_AI_TEST
Definition srv_log.h:38
LOGLEVEL_BODYGUARD
#define LOGLEVEL_BODYGUARD
Definition srv_log.h:30
unit::debug
bool debug
Definition unit.h:237
unit::server
struct unit::@81::@84 server

Definition at line 69 of file dailog.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)); \
if (log_do_output_for_level(level)) { \
real_diplo_log(ait, __FILE__, __FUNCTION__, __FC_LINE__, level, \
send_notify, pplayer, aplayer, msg, ## __VA_ARGS__); \
} \
}
BV_ISSET
#define BV_ISSET(bv, bit)
Definition bitvector.h:78
PLAYER_DEBUG_DIPLOMACY
@ PLAYER_DEBUG_DIPLOMACY
Definition player.h:215
LOGLEVEL_PLAYER
#define LOGLEVEL_PLAYER
Definition srv_log.h:36

Definition at line 53 of file dailog.h.

## ◆ LOGLEVEL_TECH

#define LOGLEVEL_TECH LOG_DEBUG

Definition at line 22 of file dailog.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)); \
if (log_do_output_for_level(level)) { \
real_tech_log(ait, __FILE__, __FUNCTION__, __FC_LINE__, level, \
send_notify, pplayer, padvance, msg, ## __VA_ARGS__); \
} \
}
LOGLEVEL_TECH
#define LOGLEVEL_TECH
Definition dailog.h:22
PLAYER_DEBUG_TECH
@ PLAYER_DEBUG_TECH
Definition player.h:215

Definition at line 36 of file dailog.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 41 of file dailog.c.

Referenced by cai_city_log(), and texwai_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 54 of file dailog.c.

Referenced by cai_unit_log(), and texwai_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,
|  |  | ...
| ) |  |