Freeciv-3.2
Loading...
Searching...
No Matches
Macros | Functions | Variables
srv_log.c File Reference
#include <stdarg.h>
#include "astring.h"
#include "log.h"
#include "shared.h"
#include "support.h"
#include "timing.h"
#include "ai.h"
#include "city.h"
#include "game.h"
#include "map.h"
#include "nation.h"
#include "unit.h"
#include "notify.h"
#include "srv_main.h"
#include "advdata.h"
#include "srv_log.h"

Go to the source code of this file.

Macros

#define AILOG_OUT(text, which)
 

Functions

void real_city_log (const char *file, const char *function, int line, enum log_level level, bool notify, const struct city *pcity, const char *msg,...)
 
void real_unit_log (const char *file, const char *function, int line, enum log_level level, bool notify, const struct unit *punit, const char *msg,...)
 
void timing_log_real (enum ai_timer timer, enum ai_timer_activity activity)
 
void timing_results_real (void)
 
void timing_log_init (void)
 
void timing_log_free (void)
 

Variables

static struct timeraitimer [AIT_LAST][2]
 
static int recursion [AIT_LAST]
 

Macro Definition Documentation

◆ AILOG_OUT

#define AILOG_OUT (   text,
  which 
)
Value:
fc_snprintf(buf, sizeof(buf), " %s: %g sec turn, %g sec game", text, \
char * incite_cost
Definition comments.c:75
const struct ft_color ftc_log
static struct timer * aitimer[AIT_LAST][2]
Definition srv_log.c:44
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
double timer_read_seconds(struct timer *t)
Definition timing.c:384

Function Documentation

◆ real_city_log()

void real_city_log ( const char file,
const char function,
int  line,
enum log_level  level,
bool  notify,
const struct city pcity,
const char msg,
  ... 
)

Log city messages, they will appear like this 2: Polish Romenna(5,35) [s1 d106 u11 g1] must have Archers ...

Definition at line 53 of file srv_log.c.

◆ real_unit_log()

void real_unit_log ( const char file,
const char function,
int  line,
enum log_level  level,
bool  notify,
const struct unit punit,
const char msg,
  ... 
)

Log unit messages, they will appear like this 2: Polish Archers[139] (5,35)->(0,0){0,0} stays to defend city where [] is unit id, ()->() are coordinates present and goto, and {,} contains bodyguard and ferryboat ids.

Definition at line 87 of file srv_log.c.

◆ timing_log_free()

void timing_log_free ( void  )

Free AI timing system resources

Definition at line 236 of file srv_log.c.

Referenced by server_quit().

◆ timing_log_init()

void timing_log_init ( void  )

Initialize AI timing system

Definition at line 218 of file srv_log.c.

Referenced by srv_init().

◆ timing_log_real()

void timing_log_real ( enum ai_timer  timer,
enum ai_timer_activity  activity 
)

Measure the time between the calls. Used to see where in the AI too much CPU is being used.

Definition at line 129 of file srv_log.c.

◆ timing_results_real()

void timing_results_real ( void  )

Print results

Definition at line 157 of file srv_log.c.

Variable Documentation

◆ aitimer

struct timer* aitimer[AIT_LAST][2]
static

Definition at line 44 of file srv_log.c.

Referenced by timing_log_free(), timing_log_init(), and timing_log_real().

◆ recursion

int recursion[AIT_LAST]
static