Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
log.qh File Reference
#include "progname.qh"
Include dependency graph for log.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __SOURCELOC__   (sprintf("^7%s^9(^9%s^7:^9%s^7)\n", __FUNC__, __FILE__, STR(__LINE__)))
#define _assert(f, expr, then)
#define _backtrace()
#define _LOG(func_header, level, func_msg, s)
#define _LOG_DEBUG(s)
#define _LOG_FATAL(s)
#define _LOG_HEADER(level, full)
#define _LOG_HELP(s)
#define _LOG_INFO(s)
#define _LOG_SEVERE(s)
#define _LOG_TRACE(s)
#define _LOG_WARN(s)
#define assert(expr, ...)
#define ASSERT_LESS(name, var, const)
#define assert_once(expr, ...)
#define backtrace(msg)
#define demand(expr, ...)
#define devassert(...)
#define devassert_once(...)
#define devdemand(...)
#define LOG_DEBUG(...)
#define LOG_DEBUGF(...)
#define LOG_FATAL(...)
#define LOG_FATALF(...)
#define LOG_HELP(...)
#define LOG_HELPF(...)
#define LOG_INFO(...)
#define LOG_INFOF(...)
#define LOG_SEVERE(...)
#define LOG_SEVEREF(...)
#define LOG_TRACE(...)
#define LOG_TRACEF(...)
#define LOG_WARN(...)
#define LOG_WARNF(...)

Functions

void print_assertfailed_fatal (string expr)
void print_assertfailed_severe (string expr)

Variables

noref int autocvar_developer
noref bool autocvar_prvm_backtraceforwarnings

Macro Definition Documentation

◆ __SOURCELOC__

#define __SOURCELOC__   (sprintf("^7%s^9(^9%s^7:^9%s^7)\n", __FUNC__, __FILE__, STR(__LINE__)))

Definition at line 42 of file log.qh.

◆ _assert

#define _assert ( f,
expr,
then )
Value:
MACRO_BEGIN \
if (!(expr)) \
{ \
f(#expr); \
then; \
} \
#define MACRO_END
Definition macro.qh:7

Definition at line 25 of file log.qh.

25#define _assert(f, expr, then) \
26 MACRO_BEGIN \
27 if (!(expr)) \
28 { \
29 f(#expr); \
30 then; \
31 } \
32 MACRO_END

◆ _backtrace

#define _backtrace ( )
Value:
builtin_remove(NULL)
#define NULL
Definition post.qh:14

Definition at line 94 of file log.qh.

◆ _LOG

#define _LOG ( func_header,
level,
func_msg,
s )
Value:
MACRO_BEGIN \
func_header(_LOG_HEADER(level, autocvar_developer > 0)); \
func_msg(strcat("^7", s, "\n")); \
noref int autocvar_developer
Definition log.qh:96
#define _LOG_HEADER(level, full)
Definition log.qh:45
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

Definition at line 47 of file log.qh.

47#define _LOG(func_header, level, func_msg, s) \
48 MACRO_BEGIN \
49 func_header(_LOG_HEADER(level, autocvar_developer > 0)); \
50 func_msg(strcat("^7", s, "\n")); \
51 MACRO_END

◆ _LOG_DEBUG

#define _LOG_DEBUG ( s)
Value:
if (autocvar_developer > 1) _LOG(dprint, "^2DEBUG", dprint, s)
#define _LOG(func_header, level, func_msg, s)
Definition log.qh:47
void dprint(string text,...)

Definition at line 82 of file log.qh.

◆ _LOG_FATAL

#define _LOG_FATAL ( s)
Value:
_LOG(print, "^1FATAL", error, s)
void print(string text,...)
#define error
Definition pre.qh:6

Definition at line 55 of file log.qh.

◆ _LOG_HEADER

#define _LOG_HEADER ( level,
full )
Value:
strcat("^9[::^7", PROGNAME, "^9::", level, "^9] ", ((full) ? __SOURCELOC__ : ""))
#define __SOURCELOC__
Definition log.qh:42
#define PROGNAME
Definition progname.qh:4

Definition at line 45 of file log.qh.

◆ _LOG_HELP

#define _LOG_HELP ( s)
Value:
MACRO_BEGIN \
string __s = s; \
print("^7", __s, (str2chr(__s, strlen(__s) - 1) != '\n') ? "\n" : ""); \
#define str2chr
#define strlen

Definition at line 87 of file log.qh.

87#define _LOG_HELP(s) \
88 MACRO_BEGIN \
89 string __s = s; \
90 print("^7", __s, (str2chr(__s, strlen(__s) - 1) != '\n') ? "\n" : ""); \
91 MACRO_END

◆ _LOG_INFO

#define _LOG_INFO ( s)
Value:
MACRO_BEGIN \
string __s = s; \
print("^7", __s); \
/* TODO: unconditionally add a newline when possible */ \
if (str2chr(__s, strlen(__s) - 1) != '\n') { print("\n"); } \
if(frag_attacker.flagcarried)
Definition sv_ctf.qc:2325

Definition at line 67 of file log.qh.

67#define _LOG_INFO(s) \
68 MACRO_BEGIN \
69 if (autocvar_developer > 0) print(_LOG_HEADER("^5INFO", autocvar_developer > 1)); \
70 string __s = s; \
71 print("^7", __s); \
72 /* TODO: unconditionally add a newline when possible */ \
73 if (str2chr(__s, strlen(__s) - 1) != '\n') { print("\n"); } \
74 MACRO_END

◆ _LOG_SEVERE

#define _LOG_SEVERE ( s)
Value:
_LOG(print, "^1SEVERE", backtrace, s)
#define backtrace(msg)
Definition log.qh:99

Definition at line 59 of file log.qh.

◆ _LOG_TRACE

#define _LOG_TRACE ( s)
Value:
_LOG(dprint, "^6TRACE", dprint, s)

Definition at line 78 of file log.qh.

◆ _LOG_WARN

#define _LOG_WARN ( s)
Value:
_LOG(print, "^3WARNING", print, s)

Definition at line 63 of file log.qh.

◆ assert

#define assert ( expr,
... )
Value:
#define _assert(f, expr, then)
Definition log.qh:25
void print_assertfailed_severe(string expr)
Definition log.qh:112

Definition at line 8 of file log.qh.

Referenced by ClientConnect(), ClientData_Send(), ClientDisconnect(), CS(), Draw_ShowNames_All(), entcs_attach(), IL_CONTAINS(), IL_INIT(), IL_POP(), IL_PUSH(), IL_REMOVE(), IL_SHIFT(), IL_UNSHIFT(), LL_POP(), LL_PUSH(), TeamScore_SendEntity(), and WriteByte().

◆ ASSERT_LESS

#define ASSERT_LESS ( name,
var,
const )
Value:
noref int name[(const - var + 1)];
string name
Definition menu.qh:30

Definition at line 34 of file log.qh.

◆ assert_once

#define assert_once ( expr,
... )
Value:
MACRO_BEGIN \
static bool __once; \
if (!__once) \
{ \
assert(expr, __VA_ARGS__); \
__once = true; \
} \

Definition at line 11 of file log.qh.

11#define assert_once(expr, ...) \
12 MACRO_BEGIN \
13 static bool __once; \
14 if (!__once) \
15 { \
16 assert(expr, __VA_ARGS__); \
17 __once = true; \
18 } \
19 MACRO_END

Referenced by RegisterTeam().

◆ backtrace

#define backtrace ( msg)
Value:
MACRO_BEGIN \
int dev = autocvar_developer; \
cvar_set("developer", "1"); \
cvar_set("prvm_backtraceforwarnings", "1"); \
print("\n--- CUT HERE ---\n", msg); \
_backtrace(); \
print("\n--- CUT UNTIL HERE ---\n"); \
cvar_set("developer", ftos(dev)); \
cvar_set("prvm_backtraceforwarnings", ftos(war)); \
noref bool autocvar_prvm_backtraceforwarnings
Definition log.qh:97
string ftos(float f)

Definition at line 99 of file log.qh.

99#define backtrace(msg) \
100 MACRO_BEGIN \
101 int dev = autocvar_developer; \
102 bool war = autocvar_prvm_backtraceforwarnings; \
103 cvar_set("developer", "1"); \
104 cvar_set("prvm_backtraceforwarnings", "1"); \
105 print("\n--- CUT HERE ---\n", msg); \
106 _backtrace(); \
107 print("\n--- CUT UNTIL HERE ---\n"); \
108 cvar_set("developer", ftos(dev)); \
109 cvar_set("prvm_backtraceforwarnings", ftos(war)); \
110 MACRO_END

Referenced by _GlobalSound(), Deathtype_Name(), EliminatedPlayers_Init(), InitializeEntitiesRun(), Local_Notification(), Mutator_Add(), Mutator_Remove(), NET_HANDLE(), Obituary(), Obituary_SpecialDeath(), Portal_TeleportPlayer(), RadiusDamageForSource(), round_handler_Spawn(), SurvivalStatuses_Init(), trigger_gravity_remove(), W_DecreaseAmmo(), waypoint_spawn(), WaypointSprite_Disown(), and weapon_thinkf().

◆ demand

#define demand ( expr,
... )
Value:
_assert(print_assertfailed_fatal, expr, __VA_ARGS__)
void print_assertfailed_fatal(string expr)
Definition log.qh:118

Definition at line 22 of file log.qh.

◆ devassert

#define devassert ( ...)
Value:
#define assert(expr,...)
Definition log.qh:8
#define MACRO_BEGIN
Definition macro.qh:6

Definition at line 9 of file log.qh.

◆ devassert_once

#define devassert_once ( ...)
Value:
#define assert_once(expr,...)
Definition log.qh:11

Definition at line 20 of file log.qh.

◆ devdemand

#define devdemand ( ...)
Value:
#define demand(expr,...)
Definition log.qh:22

Definition at line 23 of file log.qh.

◆ LOG_DEBUG

◆ LOG_DEBUGF

#define LOG_DEBUGF ( ...)

◆ LOG_FATAL

◆ LOG_FATALF

◆ LOG_HELP

#define LOG_HELP ( ...)
Value:
_LOG_HELP(strcat(__VA_ARGS__))
#define _LOG_HELP(s)
Definition log.qh:87

Definition at line 85 of file log.qh.

Referenced by BanCommand_ban(), BanCommand_banlist(), BanCommand_kickban(), BanCommand_mute(), BanCommand_playban(), BanCommand_unban(), BanCommand_unmute(), BanCommand_unplayban(), BanCommand_unvoteban(), BanCommand_voteban(), bot_cmdhelp(), bot_list_commands(), ClearCheckpointSplits(), Cmd_Scoreboard_Help(), DumpStats(), GameCommand(), GameCommand(), GameCommand_adminmsg(), GameCommand_allready(), GameCommand_allspec(), GameCommand_animbench(), GameCommand_anticheat(), GameCommand_bbox(), GameCommand_bot_cmd(), GameCommand_cointoss(), GameCommand_database(), GameCommand_defer_clear(), GameCommand_defer_clear_all(), GameCommand_delrec(), GameCommand_effectindexdump(), GameCommand_extendmatchtime(), GameCommand_gametype(), GameCommand_gettaginfo(), GameCommand_gotomap(), GameCommand_lockteams(), GameCommand_make_mapinfo(), GameCommand_moveplayer(), GameCommand_nextmap(), GameCommand_nospectators(), GameCommand_printstats(), GameCommand_radarmap(), GameCommand_reducematchtime(), GameCommand_resetmatch(), GameCommand_setbots(), GameCommand_shuffleteams(), GameCommand_stuffto(), GameCommand_trace(), GameCommand_unlockteams(), GameCommand_warp(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GenericCommand_addtolist(), GenericCommand_maplist(), GenericCommand_nextframe(), GenericCommand_qc_curl(), GenericCommand_removefromlist(), GenericCommand_restartnotifs(), GenericCommand_rpn(), GenericCommand_runtest(), GenericCommand_settemp(), GenericCommand_settemp_restore(), LocalCommand_blurtest(), LocalCommand_boxparticles(), LocalCommand_create_scrshot_ent(), LocalCommand_debugmodel(), LocalCommand_handlevote(), LocalCommand_hud(), LocalCommand_localprint(), LocalCommand_mv_download(), LocalCommand_print_cptimes(), LocalCommand_sendcvar(), RUN_ALL_TESTS(), and write_String_To_File().

◆ LOG_HELPF

◆ LOG_INFO

#define LOG_INFO ( ...)
Value:
_LOG_INFO(strcat(__VA_ARGS__))
#define _LOG_INFO(s)
Definition log.qh:67

Definition at line 65 of file log.qh.

Referenced by _MapInfo_Generate(), _MapInfo_ParseArena(), _mutPrintFail(), Accuracy_LoadLevels(), Ban_Insert(), Ban_View(), BanCommand_kickban(), BanCommand_mute(), BanCommand_playban(), BanCommand_unmute(), BanCommand_unplayban(), BanCommand_unvoteban(), BanCommand_voteban(), bd_close_editor(), bd_load_level(), bd_move(), bd_save_level(), bot_cmd_debug_assert_canfire(), bot_cmd_eval(), bot_cmd_if(), bot_decodecommand(), bot_execute_commands_once(), bot_getplace(), botframe_autowaypoints_fix(), botframe_autowaypoints_fix_from(), CampaignBailout(), CheatImpulse(), Cmd_MapVote_MapDownload(), Cmd_Scoreboard_SetFields(), CommonCommand_editmob(), CSQCPlayer_PredictTo(), Curl_URI_Get_Callback(), GameCommand(), GameCommand_adminmsg(), GameCommand_allready(), GameCommand_allspec(), GameCommand_animbench(), GameCommand_anticheat(), GameCommand_bot_cmd(), GameCommand_database(), GameCommand_defer_clear(), GameCommand_defer_clear_all(), GameCommand_effectindexdump(), GameCommand_gettaginfo(), GameCommand_gotomap(), GameCommand_moveplayer(), GameCommand_printstats(), GameCommand_stuffto(), GameCommand_trace(), GameCommand_warp(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GenericCommand_maplist(), GenericCommand_qc_curl(), GenericCommand_restartnotifs(), GenericCommand_rpn(), GetCvars(), GotoFirstMap(), HUD_Vote(), InitGameplayMode(), LocalCommand_blurtest(), LocalCommand_create_scrshot_ent(), make_mapinfo_Think(), MapInfo_LoadMap(), MapList_LoadMap(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), OnlineBanList_URI_Get_Callback(), PlayerStats_GameReport_Handler(), PlayerStats_PlayerBasic_Handler(), PlayerStats_PlayerDetail_Handler(), Portal_FindSafeOrigin(), Portal_TeleportPlayer(), print_Effect_Index(), QuickMenu_Default(), QuickMenu_Open(), RadarMap_Make(), RedirectionThink(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), relocate_spawnpoint(), RemoveTeam(), rpn_get(), rpn_pop(), rpn_push(), rpn_set(), sandbox_Database_Load(), Say(), GameItem::show(), shuffleteams(), Shutdown(), spawnfunc(), spawnfunc(), SpecialCommand(), StartFrame(), SV_Shutdown(), target_spawn_edit_entity(), teleport_findtarget(), translate_weaponarena(), trigger_disablerelay_use(), UpdateNotification_URI_Get_Callback(), URI_Get_Callback(), url_fclose(), url_multi_fopen(), url_multi_ready(), url_single_fopen(), url_URI_Get_Callback(), viewloc_init(), VoteCommand_checkargs(), W_SetupProjVelocity_Explicit(), W_SetupShot_Dir_ProjectileSize_Range(), WarpZone_InitStep_UpdateTransform(), WarpZone_PostTeleportPlayer_Callback(), WarpZone_Teleport(), waypoint_clear_start_wp_globals(), waypoint_load_hardwiredlinks(), waypoint_loadall(), waypoint_remove_fromeditor(), waypoint_spawn(), waypoint_spawn_fromeditor(), waypoint_start_hardwiredlink(), waypoint_unreachable(), WeaponStats_ready(), and XonoticSkinList_getSkins().

◆ LOG_INFOF

#define LOG_INFOF ( ...)
Value:
_LOG_INFO(sprintf(__VA_ARGS__))

Definition at line 66 of file log.qh.

Referenced by _Movetype_PushMove(), Ban_MaybeEnforceBan(), BanCommand_ban(), BanCommand_kickban(), BanCommand_mute(), BanCommand_playban(), BanCommand_unmute(), BanCommand_voteban(), BGMScript_InitEntity(), bot_decodecommand(), bot_execute_commands_once(), bot_setnameandstuff(), CheckSendCvars(), Close_Clicked(), Cmd_Scoreboard_SetFields(), Create_Notification_Entity(), Create_Notification_Entity_Annce(), Create_Notification_Entity_Choice(), Create_Notification_Entity_InfoCenter(), Create_Notification_Entity_Multi(), CSQC_Ent_Remove(), CSQC_Ent_Update(), CSQC_Parse_CenterPrint(), CSQC_Parse_Print(), CSQC_Parse_StuffCmd(), CSQC_Parse_TempEntity(), CSQCPlayer_ModelAppearance_PostUpdate(), cvar_settemp(), cvar_settemp_restore(), damage_explosion_calcpush(), Draw_WaypointSprite(), Dump_Notifications(), Dump_Turret_Settings(), Dump_Weapon_Settings(), GameCommand_bbox(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GENERIC_COMMAND(), GenericCommand_addtolist(), GenericCommand_maplist(), GenericCommand_removefromlist(), GenericCommand_restartnotifs(), GenericCommand_settemp(), HUD_Panel_ExportCfg(), LocalCommand_boxparticles(), LocalCommand_handlevote(), LocalCommand_hud(), LocalCommand_localprint(), LocalCommand_mv_download(), LocalCommand_sendcvar(), NET_HANDLE(), PlayerStats_PlayerDetail_CheckUpdate(), PlayerStats_PlayerDetail_Handler(), Process_Notif_Args(), Process_Notif_Line(), QuickMenu_Default(), QuickMenu_Open(), RadiusDamageForSource(), relocate_nexball(), relocate_spawnpoint(), Pickup::show(), SL_ProcessCategoryOverrides(), spawnfunc(), TEST(), turret_draw2d(), URI_Get_Callback(), URI_Get_Callback(), url_URI_Get_Callback(), View_Ortho(), waypoint_loadall(), waypoint_remove_fromeditor(), waypoint_save_links(), waypoint_saveall(), waypoint_spawn_fromeditor(), waypoint_start_hardwiredlink(), and waypoint_unreachable().

◆ LOG_SEVERE

#define LOG_SEVERE ( ...)
Value:
_LOG_SEVERE(strcat(__VA_ARGS__))
#define _LOG_SEVERE(s)
Definition log.qh:59

Definition at line 57 of file log.qh.

Referenced by MapInfo_LoadMapSettings(), print_assertfailed_severe(), Promise_reject(), Promise_resolve(), and REGISTRY_END().

◆ LOG_SEVEREF

#define LOG_SEVEREF ( ...)
Value:
_LOG_SEVERE(sprintf(__VA_ARGS__))

Definition at line 58 of file log.qh.

Referenced by MapInfo_LoadMapSettings(), Net_ClientCommand(), Promise_reject(), and Promise_resolve().

◆ LOG_TRACE

#define LOG_TRACE ( ...)
Value:
_LOG_TRACE(strcat(__VA_ARGS__))
#define _LOG_TRACE(s)
Definition log.qh:78

Definition at line 76 of file log.qh.

Referenced by _MapInfo_FilterGametype(), _MapInfo_Generate(), _MapInfo_Parse_Settemp(), activate_minigame(), Ban_Insert(), bot_aim(), bot_clearqueue(), bumblebee_gunner_enter(), CommonCommand_timein(), CSQCModel_AutoTagIndex_Apply(), ctf_DelayedInit(), ctf_FlagThink(), ctf_Handle_Pickup(), cvar_settemp(), DistributeEvenly_Init(), dom_DelayedInit(), draw_Text(), end_minigame(), ewheel_findtarget(), GameCommand_adminmsg(), GenericCommand_settemp(), GenericCommand_settemp_restore(), havocbot_chooserole(), havocbot_moveto(), havocbot_movetogoal(), havocbot_role_ctf_setrole(), havocbot_role_ft_freeing(), havocbot_role_ft_offense(), havocbot_role_kh_carrier(), havocbot_role_kh_defense(), havocbot_role_kh_freelancer(), havocbot_role_kh_offense(), HUD_Main(), invasion_SpawnChosenMonster(), Item_FindTeam(), ItemSend(), LinkDoors(), m_keydown(), m_keyup(), MapHasRightSize(), MaplistMethod_Iterate(), MaplistMethod_Random(), MaplistMethod_Repeat(), MapReadSizes(), minigame_read_owner(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nb_spawnteam(), NET_HANDLE(), nmm_server_event(), OnlineBanList_URI_Get_Callback(), pathlib_astar(), pathlib_close_node(), pathlib_expandnode_star(), pathlib_walknode(), pathlib_waypointpath(), pathlib_waypointpath_step(), PlayerJump(), prandom(), psrandom(), REGISTER_MUTATOR(), ResetBall(), Shutdown(), skeleton_loadinfo(), Spawn_Score(), start_minigame(), STATIC_INIT(), SUB_NoImpactCheck(), superspec_save_client_conf(), tdm_DelayedInit(), tmayhem_DelayedInit(), tracebox_inverted(), turret_checkpoint_init(), turret_findtarget(), turret_use(), turret_validate_target(), updateConwidths(), UpdateNotification_URI_Get_Callback(), vehicles_exit(), viewloc_SetViewLocation(), W_Reload(), walker_findtarget(), WarpZone_Touch(), WarpZone_TraceBox_ThroughZone(), WarpZone_TraceToss_ThroughZone(), WarpZoneLib_BoxTouchesBrush_Recurse(), waypoint_load_hardwiredlinks(), waypoint_load_links(), waypoint_loadall(), waypoint_save_hardwiredlinks(), waypoint_spawn(), WinningCondition_LMS(), XonoticResolutionSlider_loadResolutions(), and XonoticStatsList_getStats().

◆ LOG_TRACEF

◆ LOG_WARN

◆ LOG_WARNF

Function Documentation

◆ print_assertfailed_fatal()

void print_assertfailed_fatal ( string expr)

Definition at line 118 of file log.qh.

119{
120 // this is inside a function to avoid expanding it on compilation everytime
121 LOG_FATAL("assertion failed: `", expr, "`\n");
122}
#define LOG_FATAL(...)
Definition log.qh:53

References LOG_FATAL.

◆ print_assertfailed_severe()

void print_assertfailed_severe ( string expr)

Definition at line 112 of file log.qh.

113{
114 // this is inside a function to avoid expanding it on compilation everytime
115 LOG_SEVERE("assertion failed: `", expr, "`\n");
116}
#define LOG_SEVERE(...)
Definition log.qh:57

References LOG_SEVERE.

Variable Documentation

◆ autocvar_developer

noref int autocvar_developer

◆ autocvar_prvm_backtraceforwarnings

noref bool autocvar_prvm_backtraceforwarnings

Definition at line 97 of file log.qh.