Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
srv_log.h File Reference
#include "bitvector.h"
#include "log.h"
#include "support.h"
#include "fc_types.h"

Go to the source code of this file.

Macros

#define LOGLEVEL_BODYGUARD   LOG_DEBUG
 
#define LOGLEVEL_UNIT   LOG_DEBUG
 
#define LOGLEVEL_GOTO   LOG_DEBUG
 
#define LOGLEVEL_CITY   LOG_DEBUG
 
#define LOGLEVEL_BUILD   LOG_DEBUG
 
#define LOGLEVEL_HUNT   LOG_DEBUG
 
#define LOGLEVEL_PLAYER   LOG_DEBUG
 
#define LOG_AI_TEST   LOG_NORMAL
 
#define CITY_LOG(loglevel, pcity, msg, ...)
 
#define UNIT_LOG(loglevel, punit, msg, ...)
 
#define TIMING_LOG(timer, activity)
 
#define TIMING_RESULTS()
 

Enumerations

enum  ai_timer {
  AIT_ALL , AIT_MOVEMAP , AIT_UNITS , AIT_SETTLERS ,
  AIT_WORKERS , AIT_AIDATA , AIT_GOVERNMENT , AIT_TAXES ,
  AIT_CITIES , AIT_CITIZEN_ARRANGE , AIT_BUILDINGS , AIT_DANGER ,
  AIT_TECH , AIT_FSTK , AIT_DEFENDERS , AIT_CARAVAN ,
  AIT_HUNTER , AIT_AIRLIFT , AIT_DIPLOMAT , AIT_AIRUNIT ,
  AIT_EXPLORER , AIT_EMERGENCY , AIT_CITY_MILITARY , AIT_CITY_TERRAIN ,
  AIT_CITY_SETTLERS , AIT_ATTACK , AIT_MILITARY , AIT_RECOVER ,
  AIT_BODYGUARD , AIT_FERRY , AIT_RAMPAGE , AIT_LAST
}
 
enum  ai_timer_activity { TIMER_START , TIMER_STOP }
 

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,...) fc__attribute((__format__(__printf__
 
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,...) fc__attribute((__format__(__printf__
 
void timing_log_init (void)
 
void timing_log_free (void)
 
void timing_log_real (enum ai_timer timer, enum ai_timer_activity activity)
 
void timing_results_real (void)
 

Macro Definition Documentation

◆ CITY_LOG

#define CITY_LOG (   loglevel,
  pcity,
  msg,
  ... 
)
Value:
{ \
bool notify = pcity->server.debug; \
: MIN(loglevel, LOGLEVEL_CITY)); \
pcity, msg, ## __VA_ARGS__); \
} \
}
char * incite_cost
Definition comments.c:76
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 int const struct action *paction struct unit struct city * pcity
Definition dialogs_g.h:78
#define __FC_LINE__
Definition log.h:41
#define log_do_output_for_level(level)
Definition log.h:90
log_level
Definition log.h:29
struct setting_list * level[OLEVELS_NUM]
Definition settings.c:190
#define MIN(x, y)
Definition shared.h:55
#define LOGLEVEL_CITY
Definition srv_log.h:33
#define LOG_AI_TEST
Definition srv_log.h:38
bool debug
Definition unit.h:237
struct unit::@84::@87 server

Definition at line 83 of file srv_log.h.

◆ LOG_AI_TEST

#define LOG_AI_TEST   LOG_NORMAL

Definition at line 38 of file srv_log.h.

◆ LOGLEVEL_BODYGUARD

#define LOGLEVEL_BODYGUARD   LOG_DEBUG

Definition at line 30 of file srv_log.h.

◆ LOGLEVEL_BUILD

#define LOGLEVEL_BUILD   LOG_DEBUG

Definition at line 34 of file srv_log.h.

◆ LOGLEVEL_CITY

#define LOGLEVEL_CITY   LOG_DEBUG

Definition at line 33 of file srv_log.h.

◆ LOGLEVEL_GOTO

#define LOGLEVEL_GOTO   LOG_DEBUG

Definition at line 32 of file srv_log.h.

◆ LOGLEVEL_HUNT

#define LOGLEVEL_HUNT   LOG_DEBUG

Definition at line 35 of file srv_log.h.

◆ LOGLEVEL_PLAYER

#define LOGLEVEL_PLAYER   LOG_DEBUG

Definition at line 36 of file srv_log.h.

◆ LOGLEVEL_UNIT

#define LOGLEVEL_UNIT   LOG_DEBUG

Definition at line 31 of file srv_log.h.

◆ TIMING_LOG

#define TIMING_LOG (   timer,
  activity 
)

Definition at line 125 of file srv_log.h.

◆ TIMING_RESULTS

#define TIMING_RESULTS ( )

Definition at line 126 of file srv_log.h.

◆ UNIT_LOG

#define UNIT_LOG (   loglevel,
  punit,
  msg,
  ... 
)
Value:
{ \
bool notify = punit->server.debug; \
&& tile_city(unit_tile(punit))->server.debug)) { \
notify = TRUE; \
} else { \
level = MIN(loglevel, LOGLEVEL_UNIT); \
} \
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:74
#define LOGLEVEL_UNIT
Definition srv_log.h:31
#define TRUE
Definition support.h:46
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
#define unit_tile(_pu)
Definition unit.h:404

Definition at line 98 of file srv_log.h.

Enumeration Type Documentation

◆ ai_timer

Enumerator
AIT_ALL 
AIT_MOVEMAP 
AIT_UNITS 
AIT_SETTLERS 
AIT_WORKERS 
AIT_AIDATA 
AIT_GOVERNMENT 
AIT_TAXES 
AIT_CITIES 
AIT_CITIZEN_ARRANGE 
AIT_BUILDINGS 
AIT_DANGER 
AIT_TECH 
AIT_FSTK 
AIT_DEFENDERS 
AIT_CARAVAN 
AIT_HUNTER 
AIT_AIRLIFT 
AIT_DIPLOMAT 
AIT_AIRUNIT 
AIT_EXPLORER 
AIT_EMERGENCY 
AIT_CITY_MILITARY 
AIT_CITY_TERRAIN 
AIT_CITY_SETTLERS 
AIT_ATTACK 
AIT_MILITARY 
AIT_RECOVER 
AIT_BODYGUARD 
AIT_FERRY 
AIT_RAMPAGE 
AIT_LAST 

Definition at line 40 of file srv_log.h.

◆ ai_timer_activity

Enumerator
TIMER_START 
TIMER_STOP 

Definition at line 75 of file srv_log.h.

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,
  ... 
)

◆ 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,
  ... 
)

◆ 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.