Freeciv21
Develop your civilization from humble roots to a global empire
srv_log.cpp File Reference
#include "shared.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 "advdata.h"
#include "srv_log.h"
+ Include dependency graph for srv_log.cpp:

Go to the source code of this file.

Macros

#define AILOG_OUT(text, which)
 

Functions

QString city_log_prefix (const city *pcity)
 Log a city, it will appear like this Polish Romenna(5,35) [s1 d106 u11 g1]. More...
 
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, ()->() are coordinates present and goto, and {,} contains bodyguard and ferryboat ids. More...
 
void timing_log_real (enum ai_timer timer, enum ai_timer_activity activity)
 Measure the time between the calls. More...
 
void timing_results_real ()
 Print results. More...
 
void timing_log_init ()
 Initialize AI timing system. More...
 
void timing_log_free ()
 Free AI timing system resources. More...
 

Variables

static civtimeraitimer [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, \
timer_read_seconds(aitimer[which][1])); \
qCInfo(timers_category, "%s", buf); \
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buf);
const struct ft_color ftc_log
static civtimer * aitimer[AIT_LAST][2]
Definition: srv_log.cpp:34
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
Definition: support.cpp:537
double timer_read_seconds(civtimer *t)
Read value from timer.
Definition: timing.cpp:137

Function Documentation

◆ city_log_prefix()

QString city_log_prefix ( const city pcity)

Log a city, it will appear like this Polish Romenna(5,35) [s1 d106 u11 g1].

Definition at line 43 of file srv_log.cpp.

◆ timing_log_free()

void timing_log_free ( )

Free AI timing system resources.

Definition at line 177 of file srv_log.cpp.

Referenced by server_quit().

◆ timing_log_init()

void timing_log_init ( )

Initialize AI timing system.

Definition at line 163 of file srv_log.cpp.

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 86 of file srv_log.cpp.

◆ timing_results_real()

void timing_results_real ( )

Print results.

Definition at line 114 of file srv_log.cpp.

◆ unit_log_prefix()

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, ()->() are coordinates present and goto, and {,} contains bodyguard and ferryboat ids.

Definition at line 61 of file srv_log.cpp.

Variable Documentation

◆ aitimer

civtimer* aitimer[AIT_LAST][2]
static

Definition at line 34 of file srv_log.cpp.

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

◆ recursion