Replace print calls with logger calls
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 29 Aug 2015 06:42:19 +0000 (16:42 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 29 Aug 2015 06:42:19 +0000 (16:42 +1000)
Replace print and printf calls with LOG_INFO and LOG_INFOF
Replace dprint and dprintf calls with LOG_TRACE and LOG_TRACEF

139 files changed:
qcsrc/client/bgmscript.qc
qcsrc/client/command/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/scoreboard.qc
qcsrc/client/tuba.qc
qcsrc/client/view.qc
qcsrc/common/command/generic.qc
qcsrc/common/command/rpn.qc
qcsrc/common/effects.qh
qcsrc/common/items/inventory.qh
qcsrc/common/items/item.qh
qcsrc/common/items/item/pickup.qc
qcsrc/common/items/item/pickup.qh
qcsrc/common/mapinfo.qc
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/movetypes/movetypes.qc
qcsrc/common/movetypes/push.qc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/common/physics.qc
qcsrc/common/playerstats.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/disablerelay.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/turrets/checkpoint.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/config.qc
qcsrc/common/turrets/config.qh
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/unit/ewheel.qc
qcsrc/common/turrets/unit/mlrs.qc
qcsrc/common/turrets/unit/walker.qc
qcsrc/common/util.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/unit/bumblebee.qc
qcsrc/common/viewloc.qc
qcsrc/common/weapons/calculations.qc
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/config.qh
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_shockwave.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/lib/prandom.qc
qcsrc/lib/test.qc
qcsrc/lib/urllib.qc
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/draw.qc
qcsrc/menu/item/label.qc
qcsrc/menu/menu.qc
qcsrc/menu/skin.qh
qcsrc/menu/xonotic/maplist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/skinlist.qc
qcsrc/menu/xonotic/slider_decibels.qc
qcsrc/menu/xonotic/slider_resolution.qc
qcsrc/menu/xonotic/statslist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server-testcase/framework.qc
qcsrc/server/bot/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_keyhunt.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/campaign.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/banning.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/ent_cs.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/mapvoting.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_cts.qc
qcsrc/server/mutators/gamemode_domination.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_invasion.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/gamemode_race.qc
qcsrc/server/mutators/gamemode_tdm.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_physical_items.qc
qcsrc/server/mutators/mutator_random_gravity.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/mutators/sandbox.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib/expandnode.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/movenode.qc
qcsrc/server/pathlib/path_waypoint.qc
qcsrc/server/playerdemo.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/t_plats.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponstats.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/server.qc

index 697cae91ca3296d36c9d0c79612bb575a7ab4e38..894bf6955af35a3b376199c29e12fe351ca1f5e2 100644 (file)
@@ -136,7 +136,7 @@ void BGMScript_InitEntity(entity e)
                e.bgmscriptline = e.bgmscriptline0 = i;
                if(i >= bgmscriptbufsize)
                {
-                       printf("ERROR: bgmscript does not define %s\n", e.bgmscript);
+                       LOG_INFOF("ERROR: bgmscript does not define %s\n", e.bgmscript);
                        strunzone(e.bgmscript);
                        e.bgmscript = string_null;
                }
index 9fe33a4fc00cf06d88bc51a93c45d1a20c5f72b0..b5980e216f1715d88a4af1b17e7bcb2dfd8ef228 100644 (file)
@@ -53,22 +53,22 @@ void LocalCommand_blurtest(int request)
                        blurtest_time1 = time + stof(argv(1));
                        blurtest_radius = stof(argv(2));
                        blurtest_power = stof(argv(3));
-                       print("Enabled blurtest\n");
+                       LOG_INFO("Enabled blurtest\n");
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd blurtest\n");
-                       print("  No arguments required.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
        #else
        if(request)
        {
-               print("Blurtest is not enabled on this client.\n");
+               LOG_INFO("Blurtest is not enabled on this client.\n");
                return;
        }
        #endif
@@ -104,22 +104,22 @@ void LocalCommand_boxparticles(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2boxparticles^7\n");
+                       LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
-                       print("  'effectname' is the name of a particle effect in effectinfo.txt\n");
-                       print("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
-                       print("  'org_from' is the starting origin of the box\n");
-                       print("  'org_to' is the ending origin of the box\n");
-                       print("  'dir_from' is the minimum velocity\n");
-                       print("  'dir_to' is the maximum velocity\n");
-                       print("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
-                       print("  'flags' can contain:\n");
-                       print("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
-                       print("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
-                       print("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
-                       print("    128 to draw a trail, not a box\n");
+                       LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
+                       LOG_INFO("  'effectname' is the name of a particle effect in effectinfo.txt\n");
+                       LOG_INFO("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
+                       LOG_INFO("  'org_from' is the starting origin of the box\n");
+                       LOG_INFO("  'org_to' is the ending origin of the box\n");
+                       LOG_INFO("  'dir_from' is the minimum velocity\n");
+                       LOG_INFO("  'dir_to' is the maximum velocity\n");
+                       LOG_INFO("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
+                       LOG_INFO("  'flags' can contain:\n");
+                       LOG_INFO("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    128 to draw a trail, not a box\n");
                        return;
                }
        }
@@ -142,13 +142,13 @@ void LocalCommand_create_scrshot_ent(int request)
                                fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
                                fputs(fh, "}\n");
 
-                               print("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+                               LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
 
                                fclose(fh);
                        }
                        else
                        {
-                               print("^1Error: ^7Could not dump to file!\n");
+                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
                        }
                        return;
                }
@@ -156,8 +156,8 @@ void LocalCommand_create_scrshot_ent(int request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd create_scrshot_ent\n");
-                       print("  No arguments required.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
@@ -186,8 +186,8 @@ void LocalCommand_debugmodel(int request, int argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd debugmodel model\n");
-                       print("  Where 'model' is a string of the model name to use for the debug model.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
+                       LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.\n");
                        return;
                }
        }
@@ -230,11 +230,11 @@ void LocalCommand_handlevote(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2handlevote^7\n");
+                       LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd handlevote vote\n");
-                       print("  Where 'vote' is the selection for either the current poll or uid2name.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
+                       LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
                        return;
                }
        }
@@ -306,15 +306,15 @@ void LocalCommand_hud(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2hud^7\n");
+                       LOG_INFO("Incorrect parameters for ^2hud^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
-                       print("  Where 'action' is the command to complete,\n");
-                       print("  'configname' is the name to save to for \"save\" action,\n");
-                       print("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
-                       print("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       print("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
+                       LOG_INFO("  Where 'action' is the command to complete,\n");
+                       LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
+                       LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
+                       LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
+                       LOG_INFO("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
                        return;
                }
        }
@@ -334,11 +334,11 @@ void LocalCommand_localprint(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2localprint^7\n");
+                       LOG_INFO("Incorrect parameters for ^2localprint^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd localprint \"message\"\n");
-                       print("  'message' is the centerprint message to send to yourself.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
+                       LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
                        return;
                }
        }
@@ -358,11 +358,11 @@ void LocalCommand_mv_download(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2mv_download^7\n");
+                       LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd mv_download mapid\n");
-                       print("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
+                       LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
                        return;
                }
        }
@@ -377,17 +377,17 @@ void LocalCommand_find(int request, int argc)
                        entity client;
 
                        for(client = world; (client = find(client, classname, argv(1))); )
-                               print(etos(client), "\n");
+                               LOG_INFO(etos(client), "\n");
 
                        return;
                }
 
                default:
-                       print("Incorrect parameters for ^2find^7\n");
+                       LOG_INFO("Incorrect parameters for ^2find^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd find classname\n");
-                       print("  Where 'classname' is the classname to search for.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
+                       LOG_INFO("  Where 'classname' is the classname to search for.\n");
                        return;
                }
        }
@@ -417,11 +417,11 @@ void LocalCommand_sendcvar(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2sendcvar^7\n");
+                       LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
-                       print("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
+                       LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
                        return;
                }
        }
@@ -472,7 +472,7 @@ void LocalCommand_(int request)
 void LocalCommand_macro_help()
 {
        #define CLIENT_COMMAND(name,function,description) \
-               { if(strtolower(description) != "") { print("  ^2", name, "^7: ", description, "\n"); } }
+               { if(strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
 
        CLIENT_COMMANDS(0, 0);
        #undef CLIENT_COMMAND
@@ -532,14 +532,14 @@ void GameCommand(string command)
        {
                if(argc == 1)
                {
-                       print("\nClient console commands:\n");
+                       LOG_INFO("\nClient console commands:\n");
                        LocalCommand_macro_help();
 
-                       print("\nGeneric commands shared by all programs:\n");
+                       LOG_INFO("\nGeneric commands shared by all programs:\n");
                        GenericCommand_macro_help();
 
-                       print("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
-                       print("For help about a specific command, type cl_cmd help COMMAND\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
+                       LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
 
                        return;
                }
@@ -559,7 +559,7 @@ void GameCommand(string command)
        ) return;
 
        // nothing above caught the command, must be invalid
-       print(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
+       LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
 
        return;
 }
index 80b68a6e287384480a002026329a1f8f4cba283d..49cb1c6a0d562e8173a120ba3de2a3ff65bea595 100644 (file)
@@ -137,7 +137,7 @@ void CSQCPlayer_ModelAppearance_PostUpdate(void)
                self.forceplayermodels_isgoodmodel = fexists(self.forceplayermodels_savemodel);
                self.forceplayermodels_isgoodmodel_mdl = self.forceplayermodels_savemodel;
                if(!self.forceplayermodels_isgoodmodel)
-                       printf("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
+                       LOG_INFOF("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
        }
 }
 void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
@@ -379,7 +379,7 @@ int CSQCPlayer_FallbackFrame(int f)
                case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
                case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
        }
-       printf("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
+       LOG_INFOF("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
        return f;
 }
 void CSQCPlayer_FallbackFrame_Apply(void)
@@ -450,7 +450,7 @@ void CSQCModel_AutoTagIndex_Apply(void)
                                                        // we need to prevent this from 'appening
                                                        self.tag_entity = world;
                                                        self.drawmask = 0;
-                                                       dprint("h_ model lacks weapon attachment, but v_ model is attached to it\n");
+                                                       LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it\n");
                                                }
                                        }
                                        else if(self.tag_entity.isplayermodel)
index 32028ce423caa39dd81f8d73a46d6ce753b6949d..81ae0bb5c68a49c58f6c60a638facf16f1a8d079 100644 (file)
@@ -2731,7 +2731,7 @@ void HUD_Vote(void)
                {
                        vote_yescount = 0;
                        vote_nocount = 0;
-                       print(_("^1You must answer before entering hud configure mode\n"));
+                       LOG_INFO(_("^1You must answer before entering hud configure mode\n"));
                        cvar_set("_hud_configure", "0");
                }
                if(vote_called_vote)
@@ -4811,7 +4811,7 @@ void HUD_Main (void)
                        }
                }
                if (warning)
-                       dprint("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
+                       LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
 
                cvar_set("_hud_panelorder", s);
                if(hud_panelorder_prev)
index ca7fde9e049436e99d1d8f2acd0f2b1e1f116973..33908855036027b485b0c2178af9af7c02f0a921 100644 (file)
@@ -215,11 +215,11 @@ void HUD_Panel_ExportCfg(string cfgname)
                }
                HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
 
-               printf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
+               LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
                fclose(fh);
        }
        else
-               printf(_("^1Couldn't write to %s\n"), filename);
+               LOG_INFOF(_("^1Couldn't write to %s\n"), filename);
 }
 
 void HUD_Configure_Exit_Force()
index ed50dda37878b5b7dc20e67a08f09708875215e6..85aae33c48fcfae4085b7d51fac11cc2342f0967 100644 (file)
@@ -90,7 +90,7 @@ void CSQC_Init(void)
        prvm_language = cvar_string("prvm_language");
 
 #ifdef WATERMARK
-       dprintf("^4CSQC Build information: ^1%s\n", WATERMARK);
+       LOG_TRACEF("^4CSQC Build information: ^1%s\n", WATERMARK);
 #endif
 
        int i;
@@ -245,7 +245,7 @@ float SetTeam(entity o, int Team)
                        default:
                                if(GetTeam(Team, false) == world)
                                {
-                                       dprintf("trying to switch to unsupported team %d\n", Team);
+                                       LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -261,7 +261,7 @@ float SetTeam(entity o, int Team)
                        default:
                                if(GetTeam(Team, false) == world)
                                {
-                                       dprintf("trying to switch to unsupported team %d\n", Team);
+                                       LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -457,7 +457,7 @@ void Ent_ReadPlayerScore()
        if(!isNew && n != self.sv_entnum)
        {
                //print("A CSQC entity changed its owner!\n");
-               printf("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
+               LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
                isNew = true;
                Ent_Remove();
                self.enttype = ENT_CLIENT_SCORES;
@@ -806,7 +806,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
        t = ReadByte();
 
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
+               LOG_INFOF("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
 
        // set up the "time" global for received entities to be correct for interpolation purposes
        savetime = time;
@@ -827,7 +827,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                if(t != self.enttype || bIsNewEntity)
                {
                        //print("A CSQC entity changed its type!\n");
-                       printf("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t);
+                       LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t);
                        Ent_Remove();
                        clearentity(self);
                        bIsNewEntity = 1;
@@ -837,7 +837,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
        {
                if(!bIsNewEntity)
                {
-                       printf("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
+                       LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
                        bIsNewEntity = 1;
                }
        }
@@ -944,11 +944,11 @@ void Ent_Remove()
 void CSQC_Ent_Remove()
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
+               LOG_INFOF("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
 
        if(wasfreed(self))
        {
-               print("WARNING: CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
+               LOG_INFO("WARNING: CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
                return;
        }
        if(self.enttype)
@@ -969,7 +969,7 @@ void Gamemode_Init()
 void CSQC_Parse_StuffCmd(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
+               LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
 
        localcmd(strMessage);
 }
@@ -977,16 +977,16 @@ void CSQC_Parse_StuffCmd(string strMessage)
 void CSQC_Parse_Print(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Parse_Print(\"%s\")\n", strMessage);
+               LOG_INFOF("CSQC_Parse_Print(\"%s\")\n", strMessage);
 
-       print(ColorTranslateRGB(strMessage));
+       LOG_INFO(ColorTranslateRGB(strMessage));
 }
 
 // CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.
 void CSQC_Parse_CenterPrint(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
+               LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
 
        centerprint_hud(strMessage);
 }
@@ -1275,7 +1275,7 @@ float CSQC_Parse_TempEntity()
        int nTEID = ReadByte();
 
        if (autocvar_developer_csqcentities)
-               printf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
+               LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
 
        switch (nTEID)
        {
index 037d906fbe09c1ec9f3a2b0f91a77be42c609e4a..3511c743f05b7478a6436c884775742962532b72 100644 (file)
@@ -495,7 +495,7 @@ void Cmd_MapVote_MapDownload(float argc)
 
        if(argc != 2 || !mv_pk3list)
        {
-               print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
+               LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
                return;
        }
 
@@ -505,7 +505,7 @@ void Cmd_MapVote_MapDownload(float argc)
                        break;
 
        if(!pak || pak.sv_entnum != id) {
-               print(_("^1Error:^7 Couldn't find pak index.\n"));
+               LOG_INFO(_("^1Error:^7 Couldn't find pak index.\n"));
                return;
        }
 
@@ -514,7 +514,7 @@ void Cmd_MapVote_MapDownload(float argc)
                mv_preview[id] = true;
                return;
        } else {
-               print(_("Requesting preview...\n"));
+               LOG_INFO(_("Requesting preview...\n"));
                localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n"));
        }
 }
index fbd98da95e53021332869743c5be700f3293b1d8..9bf0a855fa5375e53db412db0f7cae6d89e3efa0 100644 (file)
@@ -107,7 +107,7 @@ void RemoveTeam(entity Team)
 
        if(!tm)
        {
-               print(_("Trying to remove a team which is not in the teamlist!"));
+               LOG_INFO(_("Trying to remove a team which is not in the teamlist!"));
                return;
        }
        parent.sort_next = Team.sort_next;
@@ -566,7 +566,7 @@ void URI_Get_Callback(int id, float status, string data)
        }
        else
        {
-               printf("Received HTTP request data for an invalid id %d.\n", id);
+               LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
        }
 }
 
@@ -591,7 +591,7 @@ void Accuracy_LoadLevels()
                if(acc_levels > MAX_ACCURACY_LEVELS)
                        acc_levels = MAX_ACCURACY_LEVELS;
                if(acc_levels < 2)
-                       print("Warning: accuracy_color_levels must contain at least 2 values\n");
+                       LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values\n");
 
                int i;
                for(i = 0; i < acc_levels; ++i)
index 96b91d1c8042d4a7611e47da81b778443c625dbe..00f9543717f39c5f19c5c6e09cd7667d2f99e620 100644 (file)
@@ -48,7 +48,7 @@ void skeleton_loadinfo(entity e)
                }
        }
        else
-               dprint("No model parameters for ", e.model, "\n");
+               LOG_TRACE("No model parameters for ", e.model, "\n");
        //dprint(e.model, " uses ", ftos(e.bone_upperbody), " ", ftos(e.fixbone), "\n");
        get_model_parameters(string_null, 0);
        e.skeleton_info_modelindex = e.modelindex;
index c635e975496df63c584d1a56b8aa0253e6bd0a20..3b74f5932b0d5b9c861f1cd121b42711762947fc 100644 (file)
@@ -245,56 +245,56 @@ void HUD_UpdateTeamPos(entity Team)
 
 void Cmd_HUD_Help()
 {
-       print(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
-       print(_("^3|---------------------------------------------------------------|\n"));
-       print(_("Usage:\n"));
-       print(_("^2scoreboard_columns_set default\n"));
-       print(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
-       print(_("The following field names are recognized (case insensitive):\n"));
-       print(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
-
-       print(_("^3name^7 or ^3nick^7             Name of a player\n"));
-       print(_("^3ping^7                     Ping time\n"));
-       print(_("^3pl^7                       Packet loss\n"));
-       print(_("^3kills^7                    Number of kills\n"));
-       print(_("^3deaths^7                   Number of deaths\n"));
-       print(_("^3suicides^7                 Number of suicides\n"));
-       print(_("^3frags^7                    kills - suicides\n"));
-       print(_("^3kd^7                       The kill-death ratio\n"));
-       print(_("^3sum^7                      frags - deaths\n"));
-       print(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
-       print(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
-       print(_("^3captime^7                  Time of fastest cap (CTF)\n"));
-       print(_("^3fckills^7                  Number of flag carrier kills\n"));
-       print(_("^3returns^7                  Number of flag returns\n"));
-       print(_("^3drops^7                    Number of flag drops\n"));
-       print(_("^3lives^7                    Number of lives (LMS)\n"));
-       print(_("^3rank^7                     Player rank\n"));
-       print(_("^3pushes^7                   Number of players pushed into void\n"));
-       print(_("^3destroyed^7                Number of keys destroyed by pushing them into void\n"));
-       print(_("^3kckills^7                  Number of keys carrier kills\n"));
-       print(_("^3losses^7                   Number of times a key was lost\n"));
-       print(_("^3laps^7                     Number of laps finished (race/cts)\n"));
-       print(_("^3time^7                     Total time raced (race/cts)\n"));
-       print(_("^3fastest^7                  Time of fastest lap (race/cts)\n"));
-       print(_("^3ticks^7                    Number of ticks (DOM)\n"));
-       print(_("^3takes^7                    Number of domination points taken (DOM)\n"));
-       print(_("^3bckills^7                  Number of ball carrier kills\n"));
-       print(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
-       print(_("^3score^7                    Total score\n\n"));
-
-       print(_("Before a field you can put a + or - sign, then a comma separated list\n"
+       LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
+       LOG_INFO(_("^3|---------------------------------------------------------------|\n"));
+       LOG_INFO(_("Usage:\n"));
+       LOG_INFO(_("^2scoreboard_columns_set default\n"));
+       LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
+       LOG_INFO(_("The following field names are recognized (case insensitive):\n"));
+       LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
+
+       LOG_INFO(_("^3name^7 or ^3nick^7             Name of a player\n"));
+       LOG_INFO(_("^3ping^7                     Ping time\n"));
+       LOG_INFO(_("^3pl^7                       Packet loss\n"));
+       LOG_INFO(_("^3kills^7                    Number of kills\n"));
+       LOG_INFO(_("^3deaths^7                   Number of deaths\n"));
+       LOG_INFO(_("^3suicides^7                 Number of suicides\n"));
+       LOG_INFO(_("^3frags^7                    kills - suicides\n"));
+       LOG_INFO(_("^3kd^7                       The kill-death ratio\n"));
+       LOG_INFO(_("^3sum^7                      frags - deaths\n"));
+       LOG_INFO(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
+       LOG_INFO(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
+       LOG_INFO(_("^3captime^7                  Time of fastest cap (CTF)\n"));
+       LOG_INFO(_("^3fckills^7                  Number of flag carrier kills\n"));
+       LOG_INFO(_("^3returns^7                  Number of flag returns\n"));
+       LOG_INFO(_("^3drops^7                    Number of flag drops\n"));
+       LOG_INFO(_("^3lives^7                    Number of lives (LMS)\n"));
+       LOG_INFO(_("^3rank^7                     Player rank\n"));
+       LOG_INFO(_("^3pushes^7                   Number of players pushed into void\n"));
+       LOG_INFO(_("^3destroyed^7                Number of keys destroyed by pushing them into void\n"));
+       LOG_INFO(_("^3kckills^7                  Number of keys carrier kills\n"));
+       LOG_INFO(_("^3losses^7                   Number of times a key was lost\n"));
+       LOG_INFO(_("^3laps^7                     Number of laps finished (race/cts)\n"));
+       LOG_INFO(_("^3time^7                     Total time raced (race/cts)\n"));
+       LOG_INFO(_("^3fastest^7                  Time of fastest lap (race/cts)\n"));
+       LOG_INFO(_("^3ticks^7                    Number of ticks (DOM)\n"));
+       LOG_INFO(_("^3takes^7                    Number of domination points taken (DOM)\n"));
+       LOG_INFO(_("^3bckills^7                  Number of ball carrier kills\n"));
+       LOG_INFO(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
+       LOG_INFO(_("^3score^7                    Total score\n\n"));
+
+       LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
                "of game types, then a slash, to make the field show up only in these\n"
                "or in all but these game types. You can also specify 'all' as a\n"
                "field to show all fields available for the current game mode.\n\n"));
 
-       print(_("The special game type names 'teams' and 'noteams' can be used to\n"
+       LOG_INFO(_("The special game type names 'teams' and 'noteams' can be used to\n"
                "include/exclude ALL teams/noteams game modes.\n\n"));
 
-       print(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
-       print(_("will display name, ping and pl aligned to the left, and the fields\n"
+       LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
+       LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields\n"
                "right of the vertical bar aligned to the right.\n"));
-       print(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
+       LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
                "other gamemodes except DM.\n"));
 }
 
@@ -412,7 +412,7 @@ void Cmd_HUD_SetFields(float argc)
                        else
                        {
                                if (!nocomplain)
-                                       printf("^1Error:^7 Unknown score field: '%s'\n", str);
+                                       LOG_INFOF("^1Error:^7 Unknown score field: '%s'\n", str);
                                continue;
                        }
 :found
@@ -449,7 +449,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_title[0] = strzone(TranslateScoresLabel("name"));
                        hud_field[0] = SP_NAME;
                        ++hud_num_fields;
-                       print("fixed missing field 'name'\n");
+                       LOG_INFO("fixed missing field 'name'\n");
 
                        if(!have_separator)
                        {
@@ -464,7 +464,7 @@ void Cmd_HUD_SetFields(float argc)
                                hud_field[1] = SP_SEPARATOR;
                                hud_size[1] = stringwidth("|", false, hud_fontsize);
                                ++hud_num_fields;
-                               print("fixed missing field '|'\n");
+                               LOG_INFO("fixed missing field '|'\n");
                        }
                }
                else if(!have_separator)
@@ -474,7 +474,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth("|", false, hud_fontsize);
                        hud_field[hud_num_fields] = SP_SEPARATOR;
                        ++hud_num_fields;
-                       print("fixed missing field '|'\n");
+                       LOG_INFO("fixed missing field '|'\n");
                }
                if(!have_secondary)
                {
@@ -483,7 +483,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
                        hud_field[hud_num_fields] = ps_secondary;
                        ++hud_num_fields;
-                       printf("fixed missing field '%s'\n", scores_label[ps_secondary]);
+                       LOG_INFOF("fixed missing field '%s'\n", scores_label[ps_secondary]);
                }
                if(!have_primary)
                {
@@ -492,7 +492,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
                        hud_field[hud_num_fields] = ps_primary;
                        ++hud_num_fields;
-                       printf("fixed missing field '%s'\n", scores_label[ps_primary]);
+                       LOG_INFOF("fixed missing field '%s'\n", scores_label[ps_primary]);
                }
        }
 
index 2b9dcd0a83840e80d9126196abb6185aa7cfb878..b95dd99e324773ab5f437e5ddcc7a5fe446aae48 100644 (file)
@@ -163,7 +163,7 @@ void Tuba_Precache()
        Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
        if (Tuba_PitchStep) {
                if (!checkextension("DP_SND_SOUND7_WIP2") && !checkextension("DP_SND_SOUND7")) {
-                       print("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
+                       LOG_INFO("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
                        Tuba_PitchStep = 0;
                }
        }
index 7720f58fbe6fa73d06c2f91296852c3e43aecd5a..f1a7f2234ca0f97c42bf2f42b91e467843c65e9f 100644 (file)
@@ -471,7 +471,7 @@ void UpdateDamage()
        if (damage_dealt_time != damage_dealt_time_prev)
        {
                unaccounted_damage += unaccounted_damage_new;
-               dprint("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
+               LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
        }
        damage_dealt_time_prev = damage_dealt_time;
 
@@ -511,7 +511,7 @@ void UpdateHitsound()
                                pitch_shift = mirror_value + (mirror_value - pitch_shift);
                        }
 
-                       dprint("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
+                       LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
 
                        // todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary
                        // todo: normalize sound pressure levels? seems unnecessary
@@ -1258,7 +1258,7 @@ void CSQC_UpdateView(float w, float h)
                setproperty(VF_ANGLES, '90 0 0');
 
                #if 0
-               printf("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
+               LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
                        vtos(ov_org),
                        vtos(getpropertyvec(VF_ANGLES)),
                        ov_distance,
index 14bc58947a3660cf9e9d8448421559961766c142..0c8f85816f124f2668255db78a3872a8bb81b033 100644 (file)
@@ -50,7 +50,7 @@ void Curl_URI_Get_Callback(int id, float status, string data)
        string do_cvar = curl_uri_get_cvar[i];
        if(status != 0)
        {
-               dprintf("error: status is %d\n", status);
+               LOG_TRACEF("error: status is %d\n", status);
                if(do_cvar)
                        strunzone(do_cvar);
                return;
@@ -64,7 +64,7 @@ void Curl_URI_Get_Callback(int id, float status, string data)
        }
        if(!do_exec)
                if (!do_cvar)
-                       print(data);
+                       LOG_INFO(data);
 }
 
 
@@ -102,12 +102,12 @@ void GenericCommand_addtolist(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2addtolist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
-                       print("  Where 'variable' is what to add 'value' to.\n");
-                       print("See also: ^2removefromlist^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
+                       LOG_INFO("  Where 'variable' is what to add 'value' to.\n");
+                       LOG_INFO("See also: ^2removefromlist^7\n");
                        return;
                }
        }
@@ -169,7 +169,7 @@ void GenericCommand_qc_curl(float request, float argc)
                                curl_uri_get_pos = (curl_uri_get_pos + 1) % (URI_GET_CURL_END - URI_GET_CURL + 1);
                        }
                        else
-                               print(_("error creating curl handle\n"));
+                               LOG_INFO(_("error creating curl handle\n"));
 
                        buf_del(buf);
 
@@ -179,7 +179,7 @@ void GenericCommand_qc_curl(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
                        return;
                }
        }
@@ -219,13 +219,13 @@ void GenericCommand_dumpcommands(float request)
                                CMD_Write("\ndump of generic commands:\n");
                                GenericCommand_macro_write_aliases(fh);
 
-                               print("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
+                               LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
 
                                fclose(fh);
                        }
                        else
                        {
-                               print("^1Error: ^7Could not dump to file!\n");
+                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
                        }
                        return;
                }
@@ -233,8 +233,8 @@ void GenericCommand_dumpcommands(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
-                       print("  No arguments required.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
@@ -253,7 +253,7 @@ void GenericCommand_dumpitems(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       printf("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+                       LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
                        return;
                }
        }
@@ -284,15 +284,15 @@ void GenericCommand_dumpnotifs(float request)
                        if(fh >= 0)
                        {
                                Dump_Notifications(fh, alsoprint);
-                               printf("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
+                               LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
                                fclose(fh);
                        }
                        else
                        {
-                               printf("^1Error: ^7Could not open file '%s'!\n", filename);
+                               LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
                        }
                        #else
-                       print(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+                       LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -300,10 +300,10 @@ void GenericCommand_dumpnotifs(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
-                       print("  Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
-                       print("  if supplied with '-' output to console as well as default,\n");
-                       print("  if left blank, it will only write to default.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+                       LOG_INFO("  Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
+                       LOG_INFO("  if left blank, it will only write to default.\n");
                        return;
                }
        }
@@ -335,17 +335,17 @@ void GenericCommand_dumpweapons(float request) // WEAPONTODO: make this work wit
                        if(wep_config_file >= 0)
                        {
                                Dump_Weapon_Settings();
-                               print(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
+                               LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
                                fclose(wep_config_file);
                                wep_config_file = -1;
                                wep_config_alsoprint = -1;
                        }
                        else
                        {
-                               print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                               LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
                        }
                        #else
-                       print(_("Weapons dump command only works with sv_cmd.\n"));
+                       LOG_INFO(_("Weapons dump command only works with sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -353,10 +353,10 @@ void GenericCommand_dumpweapons(float request) // WEAPONTODO: make this work wit
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
-                       print("  Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
-                       print("  if supplied with '-' output to console as well as default,\n");
-                       print("  if left blank, it will only write to default.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
+                       LOG_INFO("  Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
+                       LOG_INFO("  if left blank, it will only write to default.\n");
                        return;
                }
        }
@@ -388,17 +388,17 @@ void GenericCommand_dumpturrets(float request)
                        if(tur_config_file >= 0)
                        {
                                Dump_Turret_Settings();
-                               print(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
+                               LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
                                fclose(tur_config_file);
                                tur_config_file = -1;
                                tur_config_alsoprint = -1;
                        }
                        else
                        {
-                               print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                               LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
                        }
                        #else
-                       print(_("Turrets dump command only works with sv_cmd.\n"));
+                       LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -406,10 +406,10 @@ void GenericCommand_dumpturrets(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
-                       print("  Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
-                       print("  if supplied with '-' output to console as well as default,\n");
-                       print("  if left blank, it will only write to default.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
+                       LOG_INFO("  Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
+                       LOG_INFO("  if left blank, it will only write to default.\n");
                        return;
                }
        }
@@ -432,7 +432,7 @@ void GenericCommand_maplist(float request, float argc)
                                        {
                                                if (!fexists(strcat("maps/", argv(2), ".bsp")))
                                                {
-                                                       print("maplist: ERROR: ", argv(2), " does not exist!\n");
+                                                       LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!\n");
                                                        break;
                                                }
 
@@ -493,13 +493,13 @@ void GenericCommand_maplist(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2maplist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2maplist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
-                       print("  Where 'action' is the command to complete,\n");
-                       print("  and 'map' is what it acts upon (if required).\n");
-                       print("  Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
+                       LOG_INFO("  Where 'action' is the command to complete,\n");
+                       LOG_INFO("  and 'map' is what it acts upon (if required).\n");
+                       LOG_INFO("  Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
                        return;
                }
        }
@@ -518,8 +518,8 @@ void GenericCommand_nextframe(float request, float arguments, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
-                       print("  Where command will be executed next frame of this VM\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
+                       LOG_INFO("  Where command will be executed next frame of this VM\n");
                        return;
                }
        }
@@ -553,12 +553,12 @@ void GenericCommand_removefromlist(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2removefromlist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
-                       print("  Where 'variable' is what cvar to remove 'value' from.\n");
-                       print("See also: ^2addtolist^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
+                       LOG_INFO("  Where 'variable' is what cvar to remove 'value' from.\n");
+                       LOG_INFO("See also: ^2addtolist^7\n");
                        return;
                }
        }
@@ -571,7 +571,7 @@ void GenericCommand_restartnotifs(float request)
                case CMD_REQUEST_COMMAND:
                {
                        #ifndef MENUQC
-                       printf(
+                       LOG_INFOF(
                                strcat(
                                        "Restart_Notifications(): Restarting %d notifications... ",
                                        "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
@@ -592,7 +592,7 @@ void GenericCommand_restartnotifs(float request)
                        Destroy_All_Notifications();
                        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
                        #else
-                       print(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
+                       LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -600,8 +600,8 @@ void GenericCommand_restartnotifs(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
-                       print("  No arguments required.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
@@ -617,9 +617,9 @@ void GenericCommand_settemp(float request, float argc)
                        {
                                float f = cvar_settemp(argv(1), argv(2));
                                if(f == 1)
-                                       dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
+                                       LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
                                else if(f == -1)
-                                       dprint("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
+                                       LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
                                // else cvar_settemp itself errors out
 
                                return;
@@ -627,12 +627,12 @@ void GenericCommand_settemp(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2settemp^7\n");
+                       LOG_INFO("Incorrect parameters for ^2settemp^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
-                       print("  Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
-                       print("See also: ^2settemp_restore^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
+                       LOG_INFO("  Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
+                       LOG_INFO("See also: ^2settemp_restore^7\n");
                        return;
                }
        }
@@ -647,9 +647,9 @@ void GenericCommand_settemp_restore(float request, float argc)
                        float i = cvar_settemp_restore();
 
                        if(i)
-                               dprint("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
+                               LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
                        else
-                               dprint("Nothing to restore.\n");
+                               LOG_TRACE("Nothing to restore.\n");
 
                        return;
                }
@@ -657,9 +657,9 @@ void GenericCommand_settemp_restore(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
-                       print("  No arguments required.\n");
-                       print("See also: ^2settemp^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
+                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("See also: ^2settemp^7\n");
                        return;
                }
        }
@@ -685,7 +685,7 @@ void GenericCommand_runtest(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
                        return;
                }
        }
@@ -740,7 +740,7 @@ void GenericCommand_(float request)
 void GenericCommand_macro_help()
 {
        #define GENERIC_COMMAND(name,function,description) \
-               { print("  ^2", name, "^7: ", description, "\n"); }
+               { LOG_INFO("  ^2", name, "^7: ", description, "\n"); }
 
        GENERIC_COMMANDS(0, 0, "");
        #undef GENERIC_COMMAND
index c975f98ea988418b5d13501f7cb0b3f109bad3d9..1ca075bbbdf1f614652985039cf575182f13a149 100644 (file)
@@ -13,7 +13,7 @@ string rpn_pop()
                --rpn_sp;
                return rpn_stack[rpn_sp];
        } else {
-               print("rpn: stack underflow\n");
+               LOG_INFO("rpn: stack underflow\n");
                rpn_error = true;
                return "";
        }
@@ -24,7 +24,7 @@ void rpn_push(string s)
                rpn_stack[rpn_sp] = s;
                ++rpn_sp;
        } else {
-               print("rpn: stack overflow\n");
+               LOG_INFO("rpn: stack overflow\n");
                rpn_error = true;
        }
 }
@@ -33,7 +33,7 @@ string rpn_get()
        if(rpn_sp > 0) {
                return rpn_stack[rpn_sp - 1];
        } else {
-               print("rpn: empty stack\n");
+               LOG_INFO("rpn: empty stack\n");
                rpn_error = true;
                return "";
        }
@@ -43,7 +43,7 @@ void rpn_set(string s)
        if(rpn_sp > 0) {
                rpn_stack[rpn_sp - 1] = s;
        } else {
-               print("rpn: empty stack\n");
+               LOG_INFO("rpn: empty stack\n");
                rpn_error = true;
        }
 }
@@ -107,7 +107,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                }
                                                else
                                                {
-                                                       print("rpn: empty cvar name for 'def'\n");
+                                                       LOG_INFO("rpn: empty cvar name for 'def'\n");
                                                        rpn_error = true;
                                                }
                                        } else if(rpncmd == "defs" || rpncmd == "@") {
@@ -132,7 +132,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                }
                                                else
                                                {
-                                                       print("rpn: empty cvar name for 'defs'\n");
+                                                       LOG_INFO("rpn: empty cvar name for 'defs'\n");
                                                        rpn_error = true;
                                                }
                                        } else if(rpncmd == "load") {
@@ -288,7 +288,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                                db_put(rpn_db, "stack.pos", ftos(i-2));
                                                } else {
                                                        rpn_error = 1;
-                                                       print("rpn: database underflow\n");
+                                                       LOG_INFO("rpn: database underflow\n");
                                                }
                                        } else if(rpncmd == "dbget") {
 
@@ -298,7 +298,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        rpn_push(db_get(rpn_db, strcat("stack.", ftos(i-1))));
                                                } else {
                                                        rpn_error = 1;
-                                                       print("rpn: database empty\n");
+                                                       LOG_INFO("rpn: database empty\n");
                                                }
                                        } else if(rpncmd == "dblen") {
                                                rpn_push(db_get(rpn_db, "stack.pointer"));
@@ -347,7 +347,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                if(!j)
                                                {
                                                        rpn_error = true;
-                                                       print("rpn: empty database\n");
+                                                       LOG_INFO("rpn: empty database\n");
                                                } else {
                                                        --j;
                                                        rpn_push(db_get(rpn_db, strcat("stack.", ftos(i))));
@@ -372,7 +372,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        rpn_push(db_get(rpn_db, strcat("stack.", s)));
                                                } else {
                                                        rpn_error = 1;
-                                                       print("rpn: empty database\n");
+                                                       LOG_INFO("rpn: empty database\n");
                                                }
                                        } else if(rpncmd == "dbat") {
                                                rpn_push(db_get(rpn_db, "stack.pos"));
@@ -384,7 +384,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                {
                                                        if(i < 0 || i >= j)
                                                        {
-                                                               print("rpn: database cursor out of bounds\n");
+                                                               LOG_INFO("rpn: database cursor out of bounds\n");
                                                                rpn_error = true;
                                                        }
                                                        if(!rpn_error)
@@ -398,7 +398,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                if(!j)
                                                {
                                                        rpn_error = true;
-                                                       print("rpn: empty database, cannot move cursor\n");
+                                                       LOG_INFO("rpn: empty database, cannot move cursor\n");
                                                }
                                                if(!rpn_error)
                                                {
@@ -412,7 +412,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        j = stof(db_get(rpn_db, "stack.pointer"));
                                                        if(i < 0 || i >= j)
                                                        {
-                                                               print("rpn: database cursor destination out of bounds\n");
+                                                               LOG_INFO("rpn: database cursor destination out of bounds\n");
                                                                rpn_error = true;
                                                        }
                                                        if(!rpn_error)
@@ -514,7 +514,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                {
                                                        if (!fexists(s))
                                                        {
-                                                               print("rpn: ERROR: ", s, " does not exist!\n");
+                                                               LOG_INFO("rpn: ERROR: ", s, " does not exist!\n");
                                                                rpn_error = true;
                                                        }
                                                }
@@ -553,7 +553,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                while(rpn_sp > 0)
                                {
                                        s = rpn_pop();
-                                       print("rpn: still on stack: ", s, "\n");
+                                       LOG_INFO("rpn: still on stack: ", s, "\n");
                                }
                        }
 
@@ -563,42 +563,42 @@ void GenericCommand_rpn(float request, float argc, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
-                       print("    Operator description (x: string, s: set, f: float):\n");
-                       print("    x pop ----------------------------->     : removes the top\n");
-                       print("    x dup -----------------------------> x x : duplicates the top\n");
-                       print("    x x exch --------------------------> x x : swap the top two\n");
-                       print("    /cvarname load --------------------> x   : loads a cvar\n");
-                       print("    /cvarname x def ------------------->     : writes to a cvar\n");
-                       print("    f f add|sub|mul|div|mod|pow -------> f   : adds/... two numbers\n");
-                       print("    f f and|or|xor|bitand|bitor|bitxor > f   : logical and bitwise operations\n");
-                       print("    f f eq|ne|gt|ge|lt|le|max|min -----> f   : compares two numbers\n");
-                       print("    f neg|abs|sgn|rand|floor|ceil------> f   : negates/... a number\n");
-                       print("    f not|bitnot ----------------------> f   : logical and bitwise negation\n");
-                       print("    f exp|log|sin|cos -----------------> f   : exponential function & Co.\n");
-                       print("    f f f bound -----------------------> f   : bounds the middle number\n");
-                       print("    f1 f2 b when ----------------------> f   : f1 if b, f2 otherwise\n");
-                       print("    s s union|intersection|difference -> s   : set operations\n");
-                       print("    s shuffle -------------------------> s   : randomly arrange elements\n");
-                       print("    /key /value put ------------------->     : set a database key\n");
-                       print("    /key get --------------------------> s   : get a database value\n");
-                       print("    x dbpush -------------------------->     : pushes the top onto the database\n");
-                       print("    dbpop|dbget -----------------------> x   : removes/reads DB's top\n");
-                       print("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos\n");
-                       print("    dbclr ----------------------------->     : clear the DB\n");
-                       print("    s dbsave|dbload-------------------->     : save/load the DB to/from a file\n");
-                       print("    x dbins --------------------------->     : moves the top into the DB\n");
-                       print("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor\n");
-                       print("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor\n");
-                       print("    s localtime -----------------------> s   : formats the current local time\n");
-                       print("    s gmtime --------------------------> s   : formats the current UTC time\n");
-                       print("    time ------------------------------> f   : seconds since VM start\n");
-                       print("    s /MD4 digest ---------------------> s   : MD4 digest\n");
-                       print("    s /SHA256 digest ------------------> s   : SHA256 digest\n");
-                       print("    s /formatstring sprintf1s ---------> s   : sprintf with 1 string (pad, cut)\n");
-                       print("    s eval ---------------------------->     : does something eval\n");
-                       print("    Set operations operate on 'such''strings'.\n");
-                       print("    Unknown tokens insert their cvar value.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
+                       LOG_INFO("    Operator description (x: string, s: set, f: float):\n");
+                       LOG_INFO("    x pop ----------------------------->     : removes the top\n");
+                       LOG_INFO("    x dup -----------------------------> x x : duplicates the top\n");
+                       LOG_INFO("    x x exch --------------------------> x x : swap the top two\n");
+                       LOG_INFO("    /cvarname load --------------------> x   : loads a cvar\n");
+                       LOG_INFO("    /cvarname x def ------------------->     : writes to a cvar\n");
+                       LOG_INFO("    f f add|sub|mul|div|mod|pow -------> f   : adds/... two numbers\n");
+                       LOG_INFO("    f f and|or|xor|bitand|bitor|bitxor > f   : logical and bitwise operations\n");
+                       LOG_INFO("    f f eq|ne|gt|ge|lt|le|max|min -----> f   : compares two numbers\n");
+                       LOG_INFO("    f neg|abs|sgn|rand|floor|ceil------> f   : negates/... a number\n");
+                       LOG_INFO("    f not|bitnot ----------------------> f   : logical and bitwise negation\n");
+                       LOG_INFO("    f exp|log|sin|cos -----------------> f   : exponential function & Co.\n");
+                       LOG_INFO("    f f f bound -----------------------> f   : bounds the middle number\n");
+                       LOG_INFO("    f1 f2 b when ----------------------> f   : f1 if b, f2 otherwise\n");
+                       LOG_INFO("    s s union|intersection|difference -> s   : set operations\n");
+                       LOG_INFO("    s shuffle -------------------------> s   : randomly arrange elements\n");
+                       LOG_INFO("    /key /value put ------------------->     : set a database key\n");
+                       LOG_INFO("    /key get --------------------------> s   : get a database value\n");
+                       LOG_INFO("    x dbpush -------------------------->     : pushes the top onto the database\n");
+                       LOG_INFO("    dbpop|dbget -----------------------> x   : removes/reads DB's top\n");
+                       LOG_INFO("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos\n");
+                       LOG_INFO("    dbclr ----------------------------->     : clear the DB\n");
+                       LOG_INFO("    s dbsave|dbload-------------------->     : save/load the DB to/from a file\n");
+                       LOG_INFO("    x dbins --------------------------->     : moves the top into the DB\n");
+                       LOG_INFO("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor\n");
+                       LOG_INFO("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor\n");
+                       LOG_INFO("    s localtime -----------------------> s   : formats the current local time\n");
+                       LOG_INFO("    s gmtime --------------------------> s   : formats the current UTC time\n");
+                       LOG_INFO("    time ------------------------------> f   : seconds since VM start\n");
+                       LOG_INFO("    s /MD4 digest ---------------------> s   : MD4 digest\n");
+                       LOG_INFO("    s /SHA256 digest ------------------> s   : SHA256 digest\n");
+                       LOG_INFO("    s /formatstring sprintf1s ---------> s   : sprintf with 1 string (pad, cut)\n");
+                       LOG_INFO("    s eval ---------------------------->     : does something eval\n");
+                       LOG_INFO("    Set operations operate on 'such''strings'.\n");
+                       LOG_INFO("    Unknown tokens insert their cvar value.\n");
                        return;
                }
        }
index 790d8a7db6ce3ebc55f6a9ef0618517051d80cf6..e6f1b6656779a3af7bda316ce67d9ec4e1ae3781 100644 (file)
@@ -145,13 +145,13 @@ void RegisterEffects_First()
     #define dedi ""
     #endif
 
-    dprintf("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
+    LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
     #undef dedi
 }
 
 void RegisterEffects_Done()
 {
-    dprint("Effects initialization successful!\n");
+    LOG_TRACE("Effects initialization successful!\n");
 }
 
 // NOW we actually activate the declarations
index 8b0d43305d9b243eb8eec33028079ebc4b125745..9b4013405d6740e7db8b23ac5a463a2bcc0e6e51 100644 (file)
@@ -19,7 +19,7 @@ void Inventory_Read(Inventory data)
         .int fld = inv_items[i];
         int prev = data.(fld);
         int next = data.(fld) = ReadByte();
-        dprintf("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
+        LOG_TRACEF("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
     ));
 }
 #endif
index bddf75b04193361e1b7ae80906397656926dce9c..ceb9a0aa4df1192c904706a711d0922f92d463b5 100644 (file)
@@ -12,7 +12,7 @@ CLASS(GameItem, Object)
     METHOD(GameItem, display, void(entity this, void(string name, string icon) returns)) {
         returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
     }
-    METHOD(GameItem, show, void(entity this)) { print("A game item\n"); }
+    METHOD(GameItem, show, void(entity this)) { LOG_INFO("A game item\n"); }
     void ITEM_HANDLE(Show, entity this) { this.show(this); }
 ENDCLASS(GameItem)
 
index 35aac2bff729080e975238591f69bcda09fae716..ade99c543aeacb710cabd4b9194d5de7bd6fc753 100644 (file)
@@ -4,7 +4,7 @@
 bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
     bool b = this.giveTo(this, item, player);
     if (b) {
-        dprintf("entity %i picked up %s\n", player, this.m_name);
+        LOG_TRACEF("entity %i picked up %s\n", player, this.m_name);
         player.inventory.inv_items[this.m_id]++;
         Inventory_update(player);
     }
index 643617068c490eec99fb279fdf43958d9d4c1e49..793230e359f831222ad7c309a7a7b001cbe332a0 100644 (file)
@@ -6,7 +6,7 @@ CLASS(Pickup, GameItem)
     ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
     ATTRIB(Pickup, m_name, string, string_null)
     METHOD(Pickup, show, void(entity this));
-    void Pickup_show(entity this) { printf("%s: %s\n", etos(this), this.m_name); }
+    void Pickup_show(entity this) { LOG_INFOF("%s: %s\n", etos(this), this.m_name); }
 #ifdef SVQC
     ATTRIB(Pickup, m_botvalue, int, 0)
     ATTRIB(Pickup, m_itemflags, int, 0)
index 0b851d53b0c5299c7625055d6f470f7925b90564..eff61dbdf713621fdb950acb44f4035408068c99 100644 (file)
@@ -169,7 +169,7 @@ float MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, i
                if(MapInfo_Get_ByName(_MapInfo_GlobItem(i), 1, 0) == 2) // if we generated one... BAIL OUT and let the caller continue in the next frame.
                        if(pAbortOnGenerate)
                        {
-                               dprint("Autogenerated a .mapinfo, doing the rest later.\n");
+                               LOG_TRACE("Autogenerated a .mapinfo, doing the rest later.\n");
                                MapInfo_progress = i / _MapInfo_globcount;
                                return 0;
                        }
@@ -287,7 +287,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        }
        if(fh < 0)
                return 0;
-       print("Analyzing ", fn, " to generate initial mapinfo\n");
+       LOG_INFO("Analyzing ", fn, " to generate initial mapinfo\n");
 
        inWorldspawn = 2;
        MapInfo_Map_flags = 0;
@@ -395,7 +395,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        }
        if(inWorldspawn)
        {
-               print(fn, " ended still in worldspawn, BUG\n");
+               LOG_INFO(fn, " ended still in worldspawn, BUG\n");
                return 0;
        }
        diameter = vlen(mapMaxs - mapMins);
@@ -428,9 +428,9 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
                MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS;
        }
 
-       dprint("-> diameter ",    ftos(diameter));
-       dprint(";  spawnpoints ", ftos(spawnpoints));
-       dprint(";  modes ",       ftos(MapInfo_Map_supportedGametypes), "\n");
+       LOG_TRACE("-> diameter ",    ftos(diameter));
+       LOG_TRACE(";  spawnpoints ", ftos(spawnpoints));
+       LOG_TRACE(";  modes ",       ftos(MapInfo_Map_supportedGametypes), "\n");
 
        fclose(fh);
 
@@ -650,7 +650,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType)
                p = strstrofs(sa, "=", 0);
                if(p < 0)
                {
-                       print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+                       LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
                        continue;
                }
                k = substring(sa, 0, p);
@@ -691,7 +691,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType)
                }
                else
                {
-                       print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+                       LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
                }
        }
 
@@ -711,39 +711,39 @@ float MapInfo_Type_FromString(string t)
 {
        if(t == "nexball")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "nb";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "freezetag")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "ft";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "keepaway")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "ka";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "invasion")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "inv";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "assault")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "as";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "race")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "rc";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "all")
                return MAPINFO_TYPE_ALL;
@@ -811,7 +811,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                {
                        fh = fopen(s, FILE_READ);
                        if(fh < 0)
-                               print("Map ", pFilename, " references not existing config file ", s, "\n");
+                               LOG_INFO("Map ", pFilename, " references not existing config file ", s, "\n");
                        else
                        {
                                for (;;)
@@ -840,23 +840,23 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                        }
                }
                else
-                       print("Map ", pFilename, " uses too many levels of inclusion\n");
+                       LOG_INFO("Map ", pFilename, " uses too many levels of inclusion\n");
        }
        else if(t == "")
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if (!cvar_value_issafe(t))
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if (!cvar_value_issafe(s))
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if(matchacl(acl, t) <= 0)
-               print("Map ", pFilename, " contains a denied setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a denied setting, ignored\n");
        else
        {
                if(type == 0) // server set
                {
-                       dprint("Applying temporary setting ", t, " := ", s, "\n");
+                       LOG_TRACE("Applying temporary setting ", t, " := ", s, "\n");
                        if(cvar("g_campaign"))
                                cvar_set(t, s); // this is a wrapper and is always temporary anyway; no need to backup old values then
                        else
@@ -864,7 +864,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                }
                else
                {
-                       dprint("Applying temporary client setting ", t, " := ", s, "\n");
+                       LOG_TRACE("Applying temporary client setting ", t, " := ", s, "\n");
                        MapInfo_Map_clientstuff = strcat(
                                        MapInfo_Map_clientstuff, "cl_cmd settemp \"", t, "\" \"", s, "\"\n"
                                        );
@@ -911,7 +911,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
 
        if(strstrofs(pFilename, "/", 0) >= 0)
        {
-               print("Invalid character in map name, ignored\n");
+               LOG_INFO("Invalid character in map name, ignored\n");
                return 0;
        }
 
@@ -1001,7 +1001,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                                error("... but I just wrote it!");
                }
 
-               print("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
+               LOG_INFO("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
        }
 
        _MapInfo_Map_Reset();
@@ -1040,7 +1040,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        else if(t == "monsters") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_MONSTERS;
                        else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
                        else
-                               dprint("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
                }
                else if(t == "hidden")
                {
@@ -1062,11 +1062,11 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                {
                        t = car(s); s = cdr(s);
                        f = MapInfo_Type_FromString(t);
-                       dprint("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
+                       LOG_TRACE("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
                        if(f)
                                _MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, true);
                        else
-                               dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
                }
                else if(t == "gametype")
                {
@@ -1075,7 +1075,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        if(f)
                                _MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
                        else
-                               dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
                }
                else if(t == "size")
                {
@@ -1086,16 +1086,16 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        t = car(s); s = cdr(s); d = stof(t);
                        t = car(s); s = cdr(s); e = stof(t);
                        if(s == "")
-                               print("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+                               LOG_INFO("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
                        else
                        {
                                t = car(s); s = cdr(s); f = stof(t);
                                if(s != "")
-                                       print("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+                                       LOG_INFO("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
                                else
                                {
                                        if(a >= d || b >= e || c >= f)
-                                               print("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
+                                               LOG_INFO("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
                                        else
                                        {
                                                MapInfo_Map_mins.x = a;
@@ -1120,7 +1120,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        }
                        else
                        {
-                               dprint("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
                        }
                }
                else if(t == "clientsettemp_for_type")
@@ -1135,13 +1135,13 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        }
                        else
                        {
-                               dprint("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
                        }
                }
                else if(t == "fog")
                {
                        if (!cvar_value_issafe(s))
-                               print("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
+                               LOG_INFO("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
                        else
                                MapInfo_Map_fog = s;
                }
@@ -1157,7 +1157,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        if(pGametypeToSet)
                        {
                                if (!cvar_value_issafe(t))
-                                       print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
+                                       LOG_INFO("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
                                else
                                        MapInfo_Map_clientstuff = strcat(
                                                MapInfo_Map_clientstuff, "cd loop \"", t, "\"\n"
@@ -1165,7 +1165,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        }
                }
                else
-                       dprint("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
+                       LOG_TRACE("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
        }
        fclose(fh);
 
@@ -1179,7 +1179,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
        MapInfo_Cache_Store();
        if(MapInfo_Map_supportedGametypes != 0)
                return r;
-       dprint("Map ", pFilename, " supports no game types, ignored\n");
+       LOG_TRACE("Map ", pFilename, " supports no game types, ignored\n");
        return 0;
 }
 float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, int pGametypeToSet)
@@ -1371,14 +1371,14 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
        {
                if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break"))
                {
-                       print("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
+                       LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
                        _MapInfo_Map_ApplyGametypeEx("", t, t);
                        return; // do not call Get_ByName!
                }
 
                if(MapInfo_Map_supportedGametypes == 0)
                {
-                       print("Mapinfo system is not functional at all. Assuming deathmatch.\n");
+                       LOG_INFO("Mapinfo system is not functional at all. Assuming deathmatch.\n");
                        MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH;
                        MapInfo_LoadMapSettings_SaveGameType(MAPINFO_TYPE_DEATHMATCH);
                        _MapInfo_Map_ApplyGametypeEx("", MAPINFO_TYPE_DEATHMATCH, MAPINFO_TYPE_DEATHMATCH);
@@ -1393,7 +1393,7 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
                }
 
                // t is now a supported mode!
-               print("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
+               LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
                MapInfo_LoadMapSettings_SaveGameType(t);
        }
        MapInfo_Get_ByName(s, 1, t);
index 2fefd53227580bb3204bb56623a02a01df4f3272..3a1cc86744c16f9ea93f40c0a3ce22801cd874d6 100644 (file)
@@ -95,7 +95,7 @@ MINIGAME_SIMPLELINKED_ENTITIES
 
 void minigame_autoclean_entity(entity e)
 {
-       dprint("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+       LOG_TRACE("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
        remove(e);
 }
 
@@ -142,7 +142,7 @@ void activate_minigame(entity minigame)
        
        if ( !minigame.descriptor || minigame.classname != "minigame" )
        {
-               dprint("Trying to activate unregistered minigame ",minigame.netname," in client\n");
+               LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client\n");
                return;
        }
        
@@ -197,7 +197,7 @@ void minigame_read_owner()
                self.owner = find(self.owner,netname,owner_name);
        while ( self.owner && self.owner.classname != "minigame" );
        if ( !self.owner )
-               dprint("Got a minigame entity without a minigame!\n");
+               LOG_TRACE("Got a minigame entity without a minigame!\n");
 }
 void ent_read_minigame()
 {
@@ -219,7 +219,7 @@ void ent_read_minigame()
                        self.entremove = minigame_entremove;
                        self.descriptor = minigame_get_descriptor(ReadString_Raw());
                        if ( !self.descriptor )
-                               dprint("Got a minigame without a client-side descriptor!\n");
+                               LOG_TRACE("Got a minigame without a client-side descriptor!\n");
                        else
                                self.minigame_event = self.descriptor.minigame_event;
                }
@@ -235,7 +235,7 @@ void ent_read_minigame()
                        minigame_read_owner();
                        float ent = ReadLong();
                        self.minigame_playerslot = ent;
-                       dprint("Player: ",GetPlayerName(ent-1),"\n");
+                       LOG_TRACE("Player: ",GetPlayerName(ent-1),"\n");
                        
                        activate = (ent == player_localnum+1 && self.owner && self.owner != active_minigame);
                        
@@ -258,9 +258,9 @@ void ent_read_minigame()
 
        if ( sf & MINIG_SF_CREATE )
        {
-               dprint("CL Reading entity: ",ftos(num_for_edict(self)),
+               LOG_TRACE("CL Reading entity: ",ftos(num_for_edict(self)),
                        " classname:",self.classname," enttype:",ftos(self.enttype) );
-               dprint(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
+               LOG_TRACE(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
        }
 }
 #undef ReadString
index fc5df6bc5f481d2db9734e18f67b0a97f47eecd6..b7ad467b8c2728ec128d8835c23157007540121f 100644 (file)
@@ -368,7 +368,7 @@ int nmm_server_event(entity minigame, string event, ...)
                                minigame.SendFlags |= MINIG_SF_UPDATE;
                        }
                        else
-                               dprint("Invalid move: ",...(2,string),"\n");
+                               LOG_TRACE("Invalid move: ",...(2,string),"\n");
                        return 1;
                }
        }
index 644bd8ec6660df141d143cbf45ae531884b60020..18a64e4264b39fd4317a8a64f3482f0e7d0aa160 100644 (file)
@@ -419,7 +419,7 @@ int ttt_ai_random(int piecemask)
                f <<= 1;
        }
        
-       dprint(sprintf("TTT AI: selected %x from %x\n",
+       LOG_TRACE(sprintf("TTT AI: selected %x from %x\n",
                        RandomSelection_chosen_float, piecemask) );
        return RandomSelection_chosen_float;
 }
@@ -437,7 +437,7 @@ int ttt_ai_block3 ( int piecemask, int piecemask_free )
        r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B3,TTT_AI_POSFLAG_C3);
        r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A1,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C3);
        r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C1);
-       dprint(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
+       LOG_TRACE(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
        r &= piecemask_free;
        return ttt_ai_random(r);
 }
@@ -450,15 +450,15 @@ string ttt_ai_choose_simple(int piecemask_self, int piecemask_opponent, int piec
 {
        int move = 0;
        
-       dprint("TTT AI: checking winning move\n");
+       LOG_TRACE("TTT AI: checking winning move\n");
        if (( move = ttt_ai_block3(piecemask_self,piecemask_free) ))
                return ttt_ai_piece_flag2pos(move); // place winning move
                
-       dprint("TTT AI: checking opponent's winning move\n");
+       LOG_TRACE("TTT AI: checking opponent's winning move\n");
        if (( move = ttt_ai_block3(piecemask_opponent,piecemask_free) ))
                return ttt_ai_piece_flag2pos(move); // block opponent
                
-       dprint("TTT AI: random move\n");
+       LOG_TRACE("TTT AI: random move\n");
        return ttt_ai_piece_flag2pos(ttt_ai_random(piecemask_free));
 }
 
@@ -508,12 +508,12 @@ void ttt_aimove(entity minigame)
                }
                        
                // TODO multiple AI difficulties
-               dprint(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
+               LOG_TRACE(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
                                piecemask_self, piecemask_opponent, piecemask_free));
                pos = ttt_ai_choose_simple(piecemask_self, piecemask_opponent, piecemask_free);
-               dprint("TTT AI: chosen move: ",pos,"\n\n");
+               LOG_TRACE("TTT AI: chosen move: ",pos,"\n\n");
                if ( !pos )
-                       dprint("Tic Tac Toe AI has derped!\n");
+                       LOG_TRACE("Tic Tac Toe AI has derped!\n");
                else
                        ttt_move(minigame,aiplayer,pos);
        }
@@ -688,4 +688,4 @@ int ttt_client_event(entity minigame, string event, ...)
        return false;
 }
 
-#endif
\ No newline at end of file
+#endif
index 157471cbd54f26be4def2d61b932580b5e132686..feb4b02944874bc692c0672b90881d6dee8094b9 100644 (file)
@@ -183,7 +183,7 @@ entity start_minigame(entity player, string minigame )
                GameLogEcho(strcat(":minigame:start:",minig.netname));
                if ( ! minigame_addplayer(minig,player) )
                {
-                       dprint("Minigame ",minig.netname," rejected the first player join!\n");
+                       LOG_TRACE("Minigame ",minig.netname," rejected the first player join!\n");
                        end_minigame(minig);
                        return world;
                }
@@ -242,7 +242,7 @@ void end_minigame(entity minigame_session)
        while( (e = findentity(e, owner, minigame_session)) )
                if ( e.minigame_autoclean )
                {
-                       dprint("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+                       LOG_TRACE("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
                        remove(e);
                }
        
@@ -427,4 +427,4 @@ void ClientCommand_minigame(int request, int argc, string command)
        sprint(self, "  Leave the current minigame\n");
        sprint(self, "Usage:^3 cmd minigame invite <player>\n");
        sprint(self, "  Invite the given player to join you in a minigame\n");
-}
\ No newline at end of file
+}
index 6a3553b1cc3b141f97811f7a537312a2eac289a8..020355077f39c2e2bb267e9c48db5e4a1d08a109 100644 (file)
@@ -211,7 +211,7 @@ void PrecacheMonsterSounds(string f)
        {
                if(tokenize_console(s) != 3)
                {
-                       dprint("Invalid sound info line: ", s, "\n");
+                       LOG_TRACE("Invalid sound info line: ", s, "\n");
                        continue;
                }
                PrecacheGlobalSound(strcat(argv(1), " ", argv(2)));
@@ -266,7 +266,7 @@ float LoadMonsterSounds(string f, float first)
        fh = fopen(f, FILE_READ);
        if(fh < 0)
        {
-               dprint("Monster sound file not found: ", f, "\n");
+               LOG_TRACE("Monster sound file not found: ", f, "\n");
                return 0;
        }
        while((s = fgets(fh)))
index 90be7738c2b4a9133babce082edf5d54b61508a6..e92e81a0dad19b2757fbc534c61659427295788a 100644 (file)
@@ -452,11 +452,11 @@ bool _Movetype_UnstickEntity()  // SV_UnstickEntity
                if(!_Movetype_TestEntityPosition('0 0 -1' * i)) goto success;
                if(!_Movetype_TestEntityPosition('0 0 1' * i)) goto success;
        }
-       dprintf("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n",
+       LOG_TRACEF("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n",
                num_for_edict(self), self.classname, vtos(self.move_origin));
        return false;
        : success;
-       dprintf("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n",
+       LOG_TRACEF("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n",
                num_for_edict(self), self.classname, vtos(self.move_origin));
        _Movetype_LinkEdict(true);
        return true;
index 1f563f58ddcf51a813dbf2e08e4c197b9ccb1fdd..954033edbe9f59256914958a0963b2fd29f6b90b 100644 (file)
@@ -26,7 +26,7 @@ void _Movetype_PushMove(float dt)  // SV_PushMove
                        _Movetype_LinkEdict(true);
                        return;
                default:
-                       dprintf("_Movetype_PushMove: entity %e, unrecognized solid type %d\n", self, self.solid);
+                       LOG_TRACEF("_Movetype_PushMove: entity %e, unrecognized solid type %d\n", self, self.solid);
                        return;
        }
 
index baa891c939825adc1d63ce75e3393df80d3bfc58..4c39d6f7d5a4f32b46ef32e20fe90910a9b9eaee 100644 (file)
@@ -262,7 +262,7 @@ STATIC_INIT(Mutators) {
 #define MUTATOR_HOOK(cb, func, order) do {                              \
     MUTATOR_ONADD {                                                     \
         if (!CallbackChain_Add(HOOK_##cb, CALLBACK_##func, order)) {    \
-            print("HOOK FAILED: ", #cb, ":", #func, "\n");              \
+            LOG_INFO("HOOK FAILED: ", #cb, ":", #func, "\n");              \
             return true;                                                \
         }                                                               \
     }                                                                   \
index c5fa1ac00bf771cc0fa4a832d4e679e1c3327682..8673b96b35717946d6ce952dc62afe25a564035b 100644 (file)
@@ -545,7 +545,7 @@ void Draw_WaypointSprite()
     if (rgb == '0 0 0')
     {
         self.teamradar_color = '1 0 1';
-        printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+        LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
     }
 
     if (time - floor(time) > 0.5)
index 03005da3432bfea9fe1778c78f1eb1746b0fcdeb..5145e5340cff8f3a78748bb88c1d107e90ac8e08 100644 (file)
@@ -296,7 +296,7 @@ string Process_Notif_Line(
        // done to both MSG_INFO and MSG_CENTER
        if(substring(input, (strlen(input) - 1), 1) == "\n")
        {
-               printf(
+               LOG_INFOF(
                        strcat(
                                "^1TRAILING NEW LINE AT END OF NOTIFICATION: ",
                                "^7net_type = %s, net_name = %s, string = %s.\n"
@@ -331,7 +331,7 @@ string Process_Notif_Args(
                        {
                                if(sel_num == NOTIF_MAX_ARGS)
                                {
-                                       printf(
+                                       LOG_INFOF(
                                                strcat(
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
                                                        "^7net_type = %s, net_name = %s, max args = %d.\n"
@@ -363,7 +363,7 @@ string Process_Notif_Args(
                                        #undef ARG_CASE_ARG_CS_SV_HA
                                        default:
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        strcat(
                                                                "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
                                                                "^7net_type = %s, net_name = %s, args arg = '%s'.\n"
@@ -382,7 +382,7 @@ string Process_Notif_Args(
                        {
                                if(sel_num == NOTIF_MAX_HUDARGS)
                                {
-                                       printf(
+                                       LOG_INFOF(
                                                strcat(
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
                                                        "^7net_type = %s, net_name = %s, max hudargs = %d.\n"
@@ -414,7 +414,7 @@ string Process_Notif_Args(
                                        #undef ARG_CASE_ARG_CS_SV_HA
                                        default:
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        strcat(
                                                                "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
                                                                "^7net_type = %s, net_name = %s, hudargs arg = '%s'.\n"
@@ -433,7 +433,7 @@ string Process_Notif_Args(
                        {
                                if(sel_num == NOTIF_MAX_DURCNT)
                                {
-                                       printf(
+                                       LOG_INFOF(
                                                strcat(
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
                                                        "^7net_type = %s, net_name = %s, max durcnt = %d.\n"
@@ -468,7 +468,7 @@ string Process_Notif_Args(
                                                if(ftos(stof(selected)) != "") { ++sel_num; }
                                                else
                                                {
-                                                       printf(
+                                                       LOG_INFOF(
                                                                strcat(
                                                                        "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
                                                                        "^7net_type = %s, net_name = %s, durcnt arg = '%s'.\n"
@@ -606,7 +606,7 @@ void Create_Notification_Entity(
                                }
                                else
                                {
-                                       printf(
+                                       LOG_INFOF(
                                                strcat(
                                                        "^1NOTIFICATION WITH NO SOUND: ",
                                                        "^7net_type = %s, net_name = %s.\n"
@@ -653,7 +653,7 @@ void Create_Notification_Entity(
                                        }
                                        else if((hudargs == "") && (durcnt ==""))
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        strcat(
                                                                "^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: ",
                                                                "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d\n"
@@ -687,7 +687,7 @@ void Create_Notification_Entity(
                                        if(icon != "") { notif.nent_icon = strzone(icon); }
                                        else
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        strcat(
                                                                "^1NOTIFICATION HAS HUDARGS BUT NO ICON: ",
                                                                "^7net_type = %s, net_name = %s.\n"
@@ -700,7 +700,7 @@ void Create_Notification_Entity(
                                }
                                else if(icon != "")
                                {
-                                       printf(
+                                       LOG_INFOF(
                                                strcat(
                                                        "^1NOTIFICATION HAS ICON BUT NO HUDARGS: ",
                                                        "^7net_type = %s, net_name = %s.\n"
@@ -719,7 +719,7 @@ void Create_Notification_Entity(
                                        if(cpid != NO_MSG) { notif.nent_cpid = cpid; }
                                        else
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        strcat(
                                                                "^1NOTIFICATION HAS DURCNT BUT NO CPID: ",
                                                                "^7net_type = %s, net_name = %s.\n"
@@ -761,7 +761,7 @@ void Create_Notification_Entity(
                                // Check to make sure a string was chosen
                                if(notif.nent_string == "")
                                {
-                                       printf(
+                                       LOG_INFOF(
                                                strcat(
                                                        "^1EMPTY NOTIFICATION: ",
                                                        "^7net_type = %s, net_name = %s.\n"
@@ -781,7 +781,7 @@ void Create_Notification_Entity(
                        // Set MSG_MULTI string/float counts
                        if((anncename == NO_MSG) && (infoname == NO_MSG) && (centername == NO_MSG))
                        {
-                               printf(
+                               LOG_INFOF(
                                        strcat(
                                                "^1NOTIFICATION WITH NO SUBCALLS: ",
                                                "^7net_type = %s, net_name = %s.\n"
@@ -825,7 +825,7 @@ void Create_Notification_Entity(
                {
                        if((chtype == NO_MSG) || (optiona == NO_MSG) || (optionb == NO_MSG))
                        {
-                               printf(
+                               LOG_INFOF(
                                        strcat(
                                                "^1NOTIFICATION IS MISSING CHOICE PARAMS: ",
                                                "^7net_type = %s, net_name = %s.\n"
@@ -872,7 +872,7 @@ void Create_Notification_Entity(
 
                                        default:
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        strcat(
                                                                "^1NOTIFICATION WITH IMPROPER TYPE: ",
                                                                "^7net_type = %d, net_name = %s.\n"
@@ -915,7 +915,7 @@ void Create_Notification_Entity(
 
                default:
                {
-                       printf(
+                       LOG_INFOF(
                                strcat(
                                        "^1NOTIFICATION WITH IMPROPER TYPE: ",
                                        "^7net_type = %d, net_name = %s.\n"
@@ -962,7 +962,7 @@ void Dump_Notifications(float fh, float alsoprint)
 {
        #define NOTIF_WRITE(a) { \
                fputs(fh, a); \
-               if(alsoprint) { print(a); } }
+               if(alsoprint) { LOG_INFO(a); } }
        #define NOTIF_WRITE_ENTITY(description) { \
                notif_msg = \
                        sprintf( \
@@ -1193,8 +1193,8 @@ void Debug_Notification(string input)
 {
        switch(autocvar_notification_debug)
        {
-               case 1: { dprint(input); break; }
-               case 2: { print(input); break; }
+               case 1: { LOG_TRACE(input); break; }
+               case 2: { LOG_INFO(input); break; }
        }
 }
 #endif
@@ -1550,7 +1550,7 @@ void Local_Notification(int net_type, int net_name, ...count)
 
                case MSG_INFO:
                {
-                       print(
+                       LOG_INFO(
                                Local_Notification_sprintf(
                                        notif.nent_string,
                                        notif.nent_args,
index cde5576897f502d0b890d6085a51cf035dc70f9e..26c77b2a5871aa04a324bb012225a8ff18f00a33 100644 (file)
@@ -1701,7 +1701,7 @@ void RegisterNotifications_First()
     #define dedi ""
     #endif
 
-    printf("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME);
+    LOG_INFOF("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME);
     #undef dedi
 
     // maybe do another implementation of this with checksums? for now, we don't need versioning
@@ -1727,9 +1727,9 @@ void RegisterNotifications_Done()
         if(autocvar_notification_errors_are_fatal)
             error("Notification initialization failed! Read above and fix the errors!\n");
         else
-            print("Notification initialization failed! Read above and fix the errors!\n");
+            LOG_INFO("Notification initialization failed! Read above and fix the errors!\n");
     }
-    else { print("Notification initialization successful!\n"); }
+    else { LOG_INFO("Notification initialization successful!\n"); }
 }
 
 // NOW we actually activate the declarations
index e5b83443fbcd3c28aecce9276cd006e5eead2e74..71e2aa2bafaa8b5d524bfd0ef6fa8443cc6d9f88 100644 (file)
@@ -624,7 +624,7 @@ bool PlayerJump (void)
        {
 #ifdef SVQC
                if(autocvar_speedmeter)
-                       dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
+                       LOG_TRACE(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
 #endif
                if(self.lastground < time - 0.3)
                {
@@ -633,7 +633,7 @@ bool PlayerJump (void)
                }
 #ifdef SVQC
                if(self.jumppadcount > 1)
-                       dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
+                       LOG_TRACE(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
                self.jumppadcount = 0;
 #endif
        }
@@ -970,7 +970,7 @@ void SpecialCommand()
        TetrisImpulse();
 #else
        if (!CheatImpulse(99))
-               print("A hollow voice says \"Plugh\".\n");
+               LOG_INFO("A hollow voice says \"Plugh\".\n");
 #endif
 #endif
 }
@@ -1483,13 +1483,13 @@ void PM_walk(float buttons_prev, float maxspd_mod)
        {
 #ifdef SVQC
                if (autocvar_speedmeter)
-                       dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
+                       LOG_TRACE(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
 #endif
                if (self.lastground < time - 0.3)
                        self.velocity *= (1 - PHYS_FRICTION_ONLAND);
 #ifdef SVQC
                if (self.jumppadcount > 1)
-                       dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
+                       LOG_TRACE(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
                self.jumppadcount = 0;
 #endif
        }
index ea783a12d6424bb35751ddc157adcda2d6205700..74004d062bcd0cb14b88b1b91568f8e76b4cad87 100644 (file)
@@ -394,9 +394,9 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                {
                        // url_fclose is processing, we got a response for writing the data
                        // this must come from HTTP
-                       dprint("Got response from player stats server:\n");
-                       while((s = url_fgets(fh))) { dprint("  ", s, "\n"); }
-                       dprint("End of response.\n");
+                       LOG_TRACE("Got response from player stats server:\n");
+                       while((s = url_fgets(fh))) { LOG_TRACE("  ", s, "\n"); }
+                       LOG_TRACE("End of response.\n");
                        url_fclose(fh);
                        break;
                }
@@ -404,7 +404,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
-                       dprint("Player stats written\n");
+                       LOG_TRACE("Player stats written\n");
                        PlayerStats_GameReport_DelayMapVote = false;
                        if(PS_GR_OUT_DB >= 0)
                        {
@@ -417,7 +417,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                case URL_READY_ERROR:
                default:
                {
-                       print("Player stats writing failed: ", ftos(status), "\n");
+                       LOG_INFO("Player stats writing failed: ", ftos(status), "\n");
                        PlayerStats_GameReport_DelayMapVote = false;
                        if(PS_GR_OUT_DB >= 0)
                        {
@@ -443,7 +443,7 @@ void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
 
                        // now request the information
                        uri = strcat(uri, "/player/", uri_escape(uri_escape(joiningplayer.crypto_idfp)), "/elo.txt");
-                       dprint("Retrieving playerstats from URL: ", uri, "\n");
+                       LOG_TRACE("Retrieving playerstats from URL: ", uri, "\n");
                        url_single_fopen(
                                uri,
                                FILE_APPEND,
@@ -484,7 +484,7 @@ void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer)
        // determine whether we should retrieve playerbasic information again
 
        #if 0
-       printf("PlayerStats_PlayerBasic_CheckUpdate('%s'): %f\n",
+       LOG_INFOF("PlayerStats_PlayerBasic_CheckUpdate('%s'): %f\n",
                joiningplayer.netname,
                time
        );
@@ -508,7 +508,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
        {
                case URL_READY_CANWRITE:
                {
-                       dprint("-- Sending data to player stats server\n");
+                       LOG_TRACE("-- Sending data to player stats server\n");
                        /*url_fputs(fh, "V 1\n");
                        #ifdef WATERMARK
                        url_fputs(fh, sprintf("R %s\n", WATERMARK));
@@ -526,11 +526,11 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                case URL_READY_CANREAD:
                {
                        string s = "";
-                       dprint("-- Got response from player stats server:\n");
+                       LOG_TRACE("-- Got response from player stats server:\n");
                        //string gametype = string_null;
                        while((s = url_fgets(fh)))
                        {
-                               dprint("  ", s, "\n");
+                               LOG_TRACE("  ", s, "\n");
                                /*
                                string key = "", value = "", data = "";
 
@@ -581,21 +581,21 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                                continue;
                                */
                        }
-                       dprint("-- End of response.\n");
+                       LOG_TRACE("-- End of response.\n");
                        url_fclose(fh);
                        break;
                }
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
-                       print("Player stats synchronized with server\n");
+                       LOG_INFO("Player stats synchronized with server\n");
                        break;
                }
 
                case URL_READY_ERROR:
                default:
                {
-                       print("Receiving player stats failed: ", ftos(status), "\n");
+                       LOG_INFO("Receiving player stats failed: ", ftos(status), "\n");
                        break;
                }
        }
@@ -610,7 +610,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
        float i = 0;
        for(e = PS_D_IN_EVL; (en = db_get(PS_D_IN_DB, e)) != ""; e = en)
        {
-               print(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
+               LOG_INFO(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
                ++i;
        }
 #endif
@@ -634,7 +634,7 @@ void PlayerStats_PlayerDetail_AddItem(string event, string data)
 
        // now actually set the event data
        db_put(PS_D_IN_DB, sprintf("#%s", event), data);
-       dprint("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB\n");
+       LOG_TRACE("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB\n");
 }
 
 void PlayerStats_PlayerDetail(void)
@@ -647,7 +647,7 @@ void PlayerStats_PlayerDetail(void)
                        PS_D_IN_DB = db_create();
 
                //uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0)));
-               dprint("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
+               LOG_TRACE("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
                url_single_fopen(
                        autocvar_g_playerstats_playerdetail_uri,
                        FILE_APPEND,
@@ -676,7 +676,7 @@ void PlayerStats_PlayerDetail_CheckUpdate(void)
        float gamecount = cvar("cl_matchcount");
 
        #if 0
-       printf("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d\n",
+       LOG_INFOF("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d\n",
                time,
                PS_D_NEXTUPDATETIME,
                PS_D_LASTGAMECOUNT,
@@ -702,7 +702,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
        {
                case URL_READY_CANWRITE:
                {
-                       dprint("PlayerStats_PlayerDetail_Handler(): Sending data to player stats server...\n");
+                       LOG_TRACE("PlayerStats_PlayerDetail_Handler(): Sending data to player stats server...\n");
                        url_fputs(fh, "V 1\n");
                        #ifdef WATERMARK
                        url_fputs(fh, sprintf("R %s\n", WATERMARK));
@@ -775,7 +775,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
 
                                        default:
                                        {
-                                               printf(
+                                               LOG_INFOF(
                                                        "PlayerStats_PlayerDetail_Handler(): ERROR: "
                                                        "Key went unhandled? Is our version outdated?\n"
                                                        "PlayerStats_PlayerDetail_Handler(): "
@@ -789,7 +789,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                }
 
                                #if 0
-                               print(sprintf(
+                               LOG_INFO(sprintf(
                                        "PlayerStats_PlayerDetail_Handler(): "
                                        "Key '%s', Event '%s', Data '%s'\n",
                                        key,
@@ -808,14 +808,14 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
-                       print("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.\n");
+                       LOG_INFO("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.\n");
                        break;
                }
 
                case URL_READY_ERROR:
                default:
                {
-                       print("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status), "\n");
+                       LOG_INFO("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status), "\n");
                        PlayerStats_PlayerDetail_Status = PS_D_STATUS_ERROR;
                        if(PS_D_IN_DB >= 0)
                        {
index 04f8f24166bb96ec1a6f699bd4c0a598e615b88f..4c56815d2ffc3488a089a23c27ab56b26d6176a8 100644 (file)
@@ -553,10 +553,10 @@ void LinkDoors()
        FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, world);
 
        // set owner, and make a loop of the chain
-       dprint("LinkDoors: linking doors:");
+       LOG_TRACE("LinkDoors: linking doors:");
        for(t = self; ; t = t.enemy)
        {
-               dprint(" ", etos(t));
+               LOG_TRACE(" ", etos(t));
                t.owner = self;
                if(t.enemy == world)
                {
@@ -564,7 +564,7 @@ void LinkDoors()
                        break;
                }
        }
-       dprint("\n");
+       LOG_TRACE("\n");
 
        // collect health, targetname, message, size
        cmins = self.absmin;
index 4594c90d971823dafc7c6efc8bc2c3249b5dd260..b3a5a24330763d13152eb088cecb0dfd9ff445df 100644 (file)
@@ -225,7 +225,7 @@ void Net_TargetMusic()
                sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
                if(getsoundtime(e, CH_BGM_SINGLE) < 0)
                {
-                       dprintf("Cannot initialize sound %s\n", e.noise);
+                       LOG_TRACEF("Cannot initialize sound %s\n", e.noise);
                        strunzone(e.noise);
                        e.noise = string_null;
                }
@@ -312,7 +312,7 @@ void Ent_ReadTriggerMusic()
                        sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE);
                        if(getsoundtime(self, CH_BGM_SINGLE) < 0)
                        {
-                               dprintf("Cannot initialize sound %s\n", self.noise);
+                               LOG_TRACEF("Cannot initialize sound %s\n", self.noise);
                                strunzone(self.noise);
                                self.noise = string_null;
                        }
index f5c54b58eb942f276e6c4503463f193f352d0d15..da7aeda71e9c628055b7223b9299eb9ba87d0625 100644 (file)
@@ -57,7 +57,7 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                        data = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", key)));
                        if(data.y == 0) // undefined field, i.e., invalid type
                        {
-                               print("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
+                               LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
                                continue;
                        }
                }
@@ -152,7 +152,7 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                                }
                                else
                                {
-                                       print("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
+                                       LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
                                        continue;
                                }
 
@@ -165,13 +165,13 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                                {
                                        if(value != "")
                                        {
-                                               print("target_spawn: try to get a field of a non-entity, ignored!\n");
+                                               LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!\n");
                                                continue;
                                        }
                                        data2 = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", valuefield)));
                                        if(data2_y == 0) // undefined field, i.e., invalid type
                                        {
-                                               print("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
+                                               LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
                                                continue;
                                        }
                                        value = getentityfieldstring(data2_x, valueent);
@@ -191,7 +191,7 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                                                        value = vtos(stov(value) + stov(valueoffset));
                                                        break;
                                                default:
-                                                       print("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
+                                                       LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
                                                        break;
                                        }
                                }
@@ -208,7 +208,7 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                                                        value = vtos(stov(value) + random() * data2_x * '1 0 0' + random() * data2_y * '0 1 0' + random() * data2_z * '0 0 1');
                                                        break;
                                                default:
-                                                       print("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
+                                                       LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
                                                        break;
                                        }
                                }
index 89a5fa20df1cef803ab61357d98e06e06d3ffd24..f7240f65a21057a57460ad40a75826a35b39f65f 100644 (file)
@@ -190,7 +190,7 @@ void teleport_findtarget (void)
                if(e.movetype == MOVETYPE_NONE)
                        waypoint_spawnforteleporter(self, e.origin, 0);
                if(e.classname != "info_teleport_destination")
-                       print("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
+                       LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
        }
 
        if(n == 0)
@@ -239,7 +239,7 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl)
        if(pl.owner == pl.realowner)
        {
                if(!(pl.flags & FL_PROJECTILE))
-                       print("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
+                       LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
                pl.owner = world;
        }
        if(IS_PLAYER(pl))
index cd5fdff322955dcbe5c86fd8e2548cfe5c48bd84..2a0432c97827790b3a6a0a483f4e86a830a26851 100644 (file)
@@ -21,7 +21,7 @@ void trigger_disablerelay_use()
        }
 
        if((!a) == (!b))
-               print("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!\n");
+               LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!\n");
 }
 
 void spawnfunc_trigger_disablerelay()
index b36b5eadb2f8f39c27f0f3aa33e9d1f93816d33b..62c37a0f49630664ccbe8a7209b58f2082abd4ff 100644 (file)
@@ -69,7 +69,7 @@ void viewloc_init()
                        break;
                }
 
-       if(!self.enemy) { print("^1FAIL!\n"); remove(self); return; }
+       if(!self.enemy) { LOG_INFO("^1FAIL!\n"); remove(self); return; }
 
        if(!self.goalentity)
                self.goalentity = self.enemy; // make them match so CSQC knows what to do
@@ -83,7 +83,7 @@ void viewloc_init()
 void spawnfunc_trigger_viewlocation()
 {
        // we won't check target2 here yet, as it may not even need to exist
-       if(self.target == "") { print("^1FAIL!\n"); remove(self); return; }
+       if(self.target == "") { LOG_INFO("^1FAIL!\n"); remove(self); return; }
 
        EXACTTRIGGER_INIT;
        InitializeEntity(self, viewloc_init, INITPRIO_FINDTARGET);
index f2fc3a8cb134a285a54dfc65cc9806b9748a7f1c..924ba7ecf008fc1c8f53b384e9e9893a304c60bf 100644 (file)
@@ -60,7 +60,7 @@ void turret_checkpoint_init()
     {
         self.enemy = find(world, targetname, self.target);
         if(self.enemy == world)
-            dprint("A turret_checkpoint faild to find its target!\n");
+            LOG_TRACE("A turret_checkpoint faild to find its target!\n");
     }
     //self.think = turret_checkpoint_think;
     //self.nextthink = time + tc_acum + 0.25;
index 1e75506ab1e46636152fb064a771c156d013575e..788f64658148d27f031fb00de12fd175801be3db 100644 (file)
@@ -110,7 +110,7 @@ void turret_draw2d()
        if(rgb == '0 0 0')
        {
                self.teamradar_color = '1 0 1';
-               printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+               LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
        }
 
        txt = self.netname;
index 547b5c6f2a4f5570bb5c8b823585f57a65a61747..f35448e9c2212dd98506391dbced0b0133658e6d 100644 (file)
@@ -48,7 +48,7 @@ void Dump_Turret_Settings(void)
                TUR_CONFIG_WRITETOFILE("// }}}\n")
 
                // step 5: debug info
-               print(sprintf("#%d: %s: %d settings...\n", i, TUR_NAME(i), TUR_CONFIG_COUNT));
+               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, TUR_NAME(i), TUR_CONFIG_COUNT));
                totalsettings += TUR_CONFIG_COUNT;
        }
 
@@ -58,5 +58,5 @@ void Dump_Turret_Settings(void)
                { tur_config_queue[x] = string_null; }
 
        // extra information
-       print(sprintf("Totals: %d turrets, %d settings\n", (i - 1), totalsettings));
+       LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (i - 1), totalsettings));
 }
index 85cbd2006c75e7abedfe63c81fe555788225b1a0..9eb69f29dd54fa804b86e94e2456e453e4dce94c 100644 (file)
@@ -17,7 +17,7 @@ string tur_config_queue[MAX_TUR_CONFIG];
 
 #define TUR_CONFIG_WRITETOFILE(a) { \
        fputs(tur_config_file, a); \
-       if(tur_config_alsoprint) { print(a); } }
+       if(tur_config_alsoprint) { LOG_INFO(a); } }
 
 #define TUR_CONFIG_WRITE_CVARS(turret,name) \
                { TUR_CONFIG_QUEUE( \
index fa5318dc2d602917a982aa14bdbfbd348da84aca..b0f1f0170d4dc3389ed3e7cb7c3f230998fb9bc2 100644 (file)
@@ -827,7 +827,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl
        */
 
 #ifdef TURRET_DEBUG_TARGETSELECT
-       dprint("Target:",e_target.netname," is a valid target for ",e_turret.netname,"\n");
+       LOG_TRACE("Target:",e_target.netname," is a valid target for ",e_turret.netname,"\n");
 #endif
 
        return 1;
@@ -1177,7 +1177,7 @@ void turret_think()
 */
 void turret_use()
 {
-       dprint("Turret ",self.netname, " used by ", activator.classname, "\n");
+       LOG_TRACE("Turret ",self.netname, " used by ", activator.classname, "\n");
 
        self.team = activator.team;
 
@@ -1361,7 +1361,7 @@ float turret_initialize(float tur_id)
                if (self.tur_defend == world)
                {
                        self.target = "";
-                       dprint("Turret has invalid defendpoint!\n");
+                       LOG_TRACE("Turret has invalid defendpoint!\n");
                }
        }
 
index f0c02cb3f7b034a08951b81db522c30e93bf0247..32bad5fb175b34a6163baf1e2fe7baeaedffe2b8 100644 (file)
@@ -212,12 +212,12 @@ float t_ewheel(float req)
                     e = find(world, targetname, self.target);
                     if (!e)
                     {
-                        dprint("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
+                        LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
                         self.target = "";
                     }
 
                     if (e.classname != "turret_checkpoint")
-                        dprint("Warning: not a turrret path\n");
+                        LOG_TRACE("Warning: not a turrret path\n");
                     else
                     {
 
index a71ba4c3bf3e734739e0c5443bca8067fad440f5..fca6a5b718ead3e93f203cf1acacf667b3a02f33 100644 (file)
@@ -35,8 +35,8 @@ float t_mlrs(float req)
             self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
             if(self.tur_head.frame < 0)
             {
-                dprint("ammo:",ftos(self.ammo),"\n");
-                dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
+                LOG_TRACE("ammo:",ftos(self.ammo),"\n");
+                LOG_TRACE("shot_dmg:",ftos(self.shot_dmg),"\n");
             }
 
             return true;
index 169f10b2411b397196a068607bcccaee649e3c6b..1375d02ae21f3278c24abd2d2f4d58eee1f76c18 100644 (file)
@@ -613,12 +613,12 @@ float t_walker(float req)
                 e = find(world, targetname, self.target);
                 if (!e)
                 {
-                    dprint("Initital waypoint for walker does NOT exsist, fix your map!\n");
+                    LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
                     self.target = "";
                 }
 
                 if (e.classname != "turret_checkpoint")
-                    dprint("Warning: not a turrret path\n");
+                    LOG_TRACE("Warning: not a turrret path\n");
                 else
                 {
 #ifdef WALKER_FANCYPATHING
index eb744a98949ae5ccdc4d2325b8359a1998521fdf..8cce4ac1c88047d5e871e4debb6622ce4e2c0251 100644 (file)
@@ -288,7 +288,7 @@ void db_save(float db, string pFilename)
        fh = fopen(pFilename, FILE_WRITE);
        if(fh < 0)
        {
-               print(strcat("^1Can't write DB to ", pFilename));
+               LOG_INFO(strcat("^1Can't write DB to ", pFilename));
                return;
        }
        n = buf_getsize(db);
@@ -382,16 +382,16 @@ void db_put(float db, string pKey, string pValue)
 void db_test()
 {
        float db, i;
-       print("LOAD...\n");
+       LOG_INFO("LOAD...\n");
        db = db_load("foo.db");
-       print("LOADED. FILL...\n");
+       LOG_INFO("LOADED. FILL...\n");
        for(i = 0; i < DB_BUCKETS; ++i)
                db_put(db, ftos(random()), "X");
-       print("FILLED. SAVE...\n");
+       LOG_INFO("FILLED. SAVE...\n");
        db_save(db, "foo.db");
-       print("SAVED. CLOSE...\n");
+       LOG_INFO("SAVED. CLOSE...\n");
        db_close(db);
-       print("CLOSED.\n");
+       LOG_INFO("CLOSED.\n");
 }
 
 // Multiline text file buffers
@@ -620,17 +620,17 @@ void compressShortVector_init()
 
        if(cvar("developer"))
        {
-               print("Verifying vector compression table...\n");
+               LOG_INFO("Verifying vector compression table...\n");
                for(i = 0x0F00; i < 0xFFFF; ++i)
                        if(i != compressShortVector(decompressShortVector(i)))
                        {
-                               print("BROKEN vector compression: ", ftos(i));
-                               print(" -> ", vtos(decompressShortVector(i)));
-                               print(" -> ", ftos(compressShortVector(decompressShortVector(i))));
-                               print("\n");
+                               LOG_INFO("BROKEN vector compression: ", ftos(i));
+                               LOG_INFO(" -> ", vtos(decompressShortVector(i)));
+                               LOG_INFO(" -> ", ftos(compressShortVector(decompressShortVector(i))));
+                               LOG_INFO("\n");
                                error("b0rk");
                        }
-               print("Done.\n");
+               LOG_INFO("Done.\n");
        }
 }
 
@@ -892,13 +892,13 @@ float cvar_settemp(string tmp_cvar, string tmp_value)
 
        if (!(tmp_cvar || tmp_value))
        {
-               dprint("Error: Invalid usage of cvar_settemp(string, string); !\n");
+               LOG_TRACE("Error: Invalid usage of cvar_settemp(string, string); !\n");
                return 0;
        }
 
        if(!cvar_type(tmp_cvar))
        {
-               printf("Error: cvar %s doesn't exist!\n", tmp_cvar);
+               LOG_INFOF("Error: cvar %s doesn't exist!\n", tmp_cvar);
                return 0;
        }
 
@@ -935,7 +935,7 @@ float cvar_settemp_restore()
                        ++i;
                }
                else
-                       printf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname);
+                       LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname);
        }
 
        return i;
@@ -1735,17 +1735,17 @@ float compressShotOrigin(vector v)
        z = rint(v.z * 4) + 128;
        if(x > 255 || x < 0)
        {
-               print("shot origin ", vtos(v), " x out of bounds\n");
+               LOG_INFO("shot origin ", vtos(v), " x out of bounds\n");
                x = bound(0, x, 255);
        }
        if(y > 255 || y < 0)
        {
-               print("shot origin ", vtos(v), " y out of bounds\n");
+               LOG_INFO("shot origin ", vtos(v), " y out of bounds\n");
                y = bound(0, y, 255);
        }
        if(z > 255 || z < 0)
        {
-               print("shot origin ", vtos(v), " z out of bounds\n");
+               LOG_INFO("shot origin ", vtos(v), " z out of bounds\n");
                z = bound(0, z, 255);
        }
        return x * 0x10000 + y * 0x100 + z;
@@ -2350,7 +2350,7 @@ void m_shutdown()
 {
        if(shutdown_running)
        {
-               print("Recursive shutdown detected! Only restoring cvars...\n");
+               LOG_INFO("Recursive shutdown detected! Only restoring cvars...\n");
        }
        else
        {
@@ -2628,7 +2628,7 @@ vector animfixfps(entity e, vector a, vector b)
 #ifdef SVQC
 void dedicated_print(string input) // print(), but only print if the server is not local
 {
-       if(server_is_dedicated) { print(input); }
+       if(server_is_dedicated) { LOG_INFO(input); }
 }
 #endif
 
index d55f797443a96baa60cff7591a60b09566d0f6f0..7b0f6553630a3ca75074367b075bc08fefb7a072 100644 (file)
@@ -572,7 +572,7 @@ void vehicles_setreturn(entity veh)
 
 void vehicle_use()
 {
-       dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
+       LOG_TRACE("vehicle ",self.netname, " used by ", activator.classname, "\n");
 
        self.tur_head.team = activator.team;
 
@@ -583,7 +583,7 @@ void vehicle_use()
 
        if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO && !gameover)
        {
-               dprint("Respawning vehicle: ", self.netname, "\n");
+               LOG_TRACE("Respawning vehicle: ", self.netname, "\n");
                if(self.effects & EF_NODRAW)
                {
                        self.think = vehicles_spawn;
@@ -832,7 +832,7 @@ void vehicles_exit(bool eject)
 
        if(vehicles_exit_running)
        {
-               dprint("^1vehicles_exit allready running! this is not good..\n");
+               LOG_TRACE("^1vehicles_exit allready running! this is not good..\n");
                return;
        }
 
@@ -1138,7 +1138,7 @@ void vehicles_think()
 // initialization
 void vehicles_spawn()
 {
-       dprint("Spawning vehicle: ", self.classname, "\n");
+       LOG_TRACE("Spawning vehicle: ", self.classname, "\n");
 
        // disown & reset
        self.vehicle_hudmodel.viewmodelforclient = self;
index 65eb131685ffe2486bab7d871e0723d872454de7..b33d3325622b14e2e27a15bc575d8eb0a2237432 100644 (file)
@@ -324,7 +324,7 @@ bool bumblebee_gunner_enter()
        }
        else if(!vehic.gunner1 && time >= vehic.gun1.phase)     { gunner = vehic.gun1; vehic.gunner1 = player; }
        else if(!vehic.gunner2 && time >= vehic.gun2.phase)             { gunner = vehic.gun2; vehic.gunner2 = player; }
-       else { dprint("Vehicle is full, fail\n"); return false; }
+       else { LOG_TRACE("Vehicle is full, fail\n"); return false; }
 
        player.vehicle                  = gunner;
        player.angles                   = vehic.angles;
index 24e6d08ebeb751925a824be5bb7940524ace2f2e..125e6f8e12f0cfa0d27ed2af62eabe33219ab890 100644 (file)
@@ -132,9 +132,9 @@ void viewloc_SetViewLocation()
                }
 
 #if 0
-               dprint(vtos(camera_position), "\n");
-               dprint(vtos(old_camera_angle), "\n");
-               dprint(vtos(camera_angle), "\n");
+               LOG_TRACE(vtos(camera_position), "\n");
+               LOG_TRACE(vtos(old_camera_angle), "\n");
+               LOG_TRACE(vtos(camera_angle), "\n");
 #endif
 
                freeze_org = getpropertyvec(VF_ORIGIN);
index 46bb8a6d45d465879915690e1ef4d51383800903..16b507d14eee683e65c13e28a42399efdd48054f 100644 (file)
@@ -55,7 +55,7 @@ vector damage_explosion_calcpush(vector explosion_f, vector target_v, float spee
        v = explosion_calcpush(explosion_f * speedfactor, m, target_v, 1, 0);
        // the factor we then get is:
        //   1
-       printf("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
+       LOG_INFOF("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
                m,
                target_v, target_v + v,
                target_v * target_v, m * explosion_f * speedfactor * explosion_f * speedfactor, target_v * target_v + m * explosion_f * speedfactor * explosion_f * speedfactor,
index 0448f4874a26c416f08d709a376705a20be8183f..b90c01f4a65abd6e300485335c03fa2bd74e32ed 100644 (file)
@@ -51,7 +51,7 @@ void Dump_Weapon_Settings(void)
                WEP_CONFIG_WRITETOFILE("// }}}\n");
 
                // step 5: debug info
-               print(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
+               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
                totalsettings += WEP_CONFIG_COUNT;
        }
 
@@ -61,5 +61,5 @@ void Dump_Weapon_Settings(void)
                { wep_config_queue[x] = string_null; }
 
        // extra information
-       print(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));
+       LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));
 }
index 4e968ec4e518629d0a1dd9c9f8319b901e75fef0..410dbdfadeb8b1f7fe79e4eeacf63bdf1a7e14d0 100644 (file)
@@ -19,7 +19,7 @@ string wep_config_queue[MAX_WEP_CONFIG];
 
 #define WEP_CONFIG_WRITETOFILE(a) do { \
        fputs(wep_config_file, a); \
-       if(wep_config_alsoprint) { print(a); } \
+       if(wep_config_alsoprint) { LOG_INFO(a); } \
 } while(0)
 
 #define WEP_CONFIG_WRITE_CVARS_NONE(wepname,name) \
index e79e38461c4117d365fc666ed8ab0f05b9065d40..fc4e2c3e0ca9ec9ae13de9353c83d2ee6cc9566e 100644 (file)
@@ -605,14 +605,14 @@ bool W_Devastator(int req)
                        #if 0
                        if(self.rl_release == 0)
                        {
-                               printf("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo));
+                               LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo));
                                return true;
                        }
                        else
                        {
                                ammo_amount = self.WEP_AMMO(DEVASTATOR) >= WEP_CVAR(devastator, ammo);
                                ammo_amount += self.(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
-                               printf("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
+                               LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
                                return ammo_amount;
                        }
                        #else
index 6d31708b43535fd7a08b2db741a72ecbb798543b..fb6cc4d5f5d9d6b1d747fdf5b993301c8042e2ce 100644 (file)
@@ -411,7 +411,7 @@ bool W_Porto(int req)
        {
                case WR_IMPACTEFFECT:
                {
-                       print("Since when does Porto send DamageInfo?\n");
+                       LOG_INFO("Since when does Porto send DamageInfo?\n");
                        return true;
                }
                case WR_INIT:
index a879bf342330defec4aca88d858bf61446e6e577..640dae3977e97899ffe4fd7dc73a6707925a4004 100644 (file)
@@ -96,7 +96,7 @@ void W_Rifle_BulletHail_Continue(void)
        af = ATTACK_FINISHED(self);
        self.switchweapon = self.weapon;
        ATTACK_FINISHED(self) = time;
-       print(ftos(self.WEP_AMMO(RIFLE)), "\n");
+       LOG_INFO(ftos(self.WEP_AMMO(RIFLE)), "\n");
        r = weapon_prepareattack(self.rifle_bullethail_frame == WFRAME_FIRE2, self.rifle_bullethail_refire);
        if(self.switchweapon == self.weapon)
                self.switchweapon = sw;
@@ -104,12 +104,12 @@ void W_Rifle_BulletHail_Continue(void)
        {
                self.rifle_bullethail_attackfunc();
                weapon_thinkf(self.rifle_bullethail_frame, self.rifle_bullethail_animtime, W_Rifle_BulletHail_Continue);
-               print("thinkf set\n");
+               LOG_INFO("thinkf set\n");
        }
        else
        {
                ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
-               print("out of ammo... ", ftos(self.weaponentity.state), "\n");
+               LOG_INFO("out of ammo... ", ftos(self.weaponentity.state), "\n");
        }
 }
 
index 40faf04025ea6fd51d60e2c4b5cac01ad3f9c518..f0e832f2bca3bb3af44b42a35552b6d6827212af 100644 (file)
@@ -189,7 +189,7 @@ void W_Shockwave_Melee_Think(void)
                                { accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
 
                        #ifdef DEBUG_SHOCKWAVE
-                       print(sprintf(
+                       LOG_INFO(sprintf(
                                "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
                                self.realowner.netname,
                                target_victim.netname,
@@ -462,7 +462,7 @@ void W_Shockwave_Attack(void)
                                );
 
                                #ifdef DEBUG_SHOCKWAVE
-                               print(sprintf(
+                               LOG_INFO(sprintf(
                                        "SELF HIT: multiplier = %f, damage = %f, force = %f... "
                                        "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
                                        multiplier,
@@ -525,7 +525,7 @@ void W_Shockwave_Attack(void)
                                if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
 
                                #ifdef DEBUG_SHOCKWAVE
-                               print(sprintf(
+                               LOG_INFO(sprintf(
                                        "SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
                                        "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
                                        multiplier,
@@ -614,7 +614,7 @@ void W_Shockwave_Attack(void)
                                if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
 
                                #ifdef DEBUG_SHOCKWAVE
-                               print(sprintf(
+                               LOG_INFO(sprintf(
                                        "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
                                        "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
                                        multiplier,
@@ -647,12 +647,12 @@ void W_Shockwave_Attack(void)
 
                if(accuracy_isgooddamage(self.realowner, head))
                {
-                       print("wtf\n");
+                       LOG_INFO("wtf\n");
                        accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, final_damage);
                }
 
                #ifdef DEBUG_SHOCKWAVE
-               print(sprintf(
+               LOG_INFO(sprintf(
                        "SHOCKWAVE by %s: damage = %f, force = %f.\n",
                        self.netname,
                        final_damage,
index 7cb3c2852244f53aa105f4d771864a4432990867..3d5f9a00cbc0679eb0cdc0234a87a3c43189e6db 100644 (file)
@@ -177,7 +177,7 @@ void CSQCPlayer_PredictTo(float endframe, float apply_error)
        {
                csqcplayer_moveframe = clientcommandframe;
                getinputstate(csqcplayer_moveframe-1);
-               print("the Weird code path got hit\n");
+               LOG_INFO("the Weird code path got hit\n");
                return;
        }
 #endif
index 975080a71a2de0f85c4857f1d6787f43c14e1121..4f588226912d92dbeba82543617734b952aa056a 100644 (file)
@@ -11,7 +11,7 @@ float prandom()
        prandom_seed = c;
 
 #ifdef USE_PRANDOM_DEBUG
-       dprint("RANDOM -> ", ftos(c), "\n");
+       LOG_TRACE("RANDOM -> ", ftos(c), "\n");
 #endif
 
        return c / 65536; // in [0..1[
@@ -36,14 +36,14 @@ void psrandom(float seed)
 {
        prandom_seed = seed;
 #ifdef USE_PRANDOM_DEBUG
-       dprint("SRANDOM ", ftos(seed), "\n");
+       LOG_TRACE("SRANDOM ", ftos(seed), "\n");
 #endif
 }
 
 #ifdef USE_PRANDOM_DEBUG
 void prandom_debug()
 {
-       dprint("Current random seed = ", ftos(prandom_seed), "\n");
+       LOG_TRACE("Current random seed = ", ftos(prandom_seed), "\n");
 }
 #endif
 #endif
index 04f9f68fe967356327968ae4d1d99168cee88c5d..23907fe5f15ed4106c69fae466807abd79fe2911 100644 (file)
@@ -5,7 +5,7 @@ float TEST_ok;
 
 void TEST_Fail(string cond)
 {
-       printf("Assertion failed: ", cond);
+       LOG_INFOF("Assertion failed: ", cond);
        //backtrace();
        ++TEST_failed;
 }
@@ -28,29 +28,29 @@ float TEST_RunAll()
        }
        if(f)
        {
-               printf("%d tests failed\n", f);
+               LOG_INFOF("%d tests failed\n", f);
                return 1;
        }
        else
        {
-               printf("All tests OK\n", f);
+               LOG_INFOF("All tests OK\n", f);
                return 0;
        }
 }
 
 float TEST_Run(string s)
 {
-       printf("%s: testing...\n", s);
+       LOG_INFOF("%s: testing...\n", s);
        TEST_failed = TEST_ok = 0;
        callfunction(strcat("_TEST_", s));
        if(TEST_failed > 0)
        {
-               printf("%s: %d items failed.\n", s, TEST_failed);
+               LOG_INFOF("%s: %d items failed.\n", s, TEST_failed);
                return 0;
        }
        else if(!TEST_ok)
        {
-               printf("%s: did not complete.\n", s);
+               LOG_INFOF("%s: did not complete.\n", s);
                return 0;
        }
        return 1;
index ce8de504b028f8c1ff654b632e196f1b86633512..9648b2080f5abb0cae734a96d3a220dcd93ae5c2 100644 (file)
@@ -35,7 +35,7 @@ float url_URI_Get_Callback(int id, float status, string data)
                return 0;
        if(e.url_rbuf >= 0 || e.url_wbuf >= 0)
        {
-               printf("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
+               LOG_INFOF("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
                return 0;
        }
 
@@ -54,7 +54,7 @@ float url_URI_Get_Callback(int id, float status, string data)
                e.url_rbuf = buf_create();
                if(e.url_rbuf < 0)
                {
-                       print("url_URI_Get_Callback: out of memory in buf_create\n");
+                       LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
                        e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                        strunzone(e.url_url);
                        remove(e);
@@ -63,7 +63,7 @@ float url_URI_Get_Callback(int id, float status, string data)
                e.url_rbufpos = 0;
                if(e.url_rbuf < 0)
                {
-                       print("url_URI_Get_Callback: out of memory in buf_create\n");
+                       LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
                        e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                        strunzone(e.url_url);
                        remove(e);
@@ -105,7 +105,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                e.url_wbuf = buf_create();
                                if(e.url_wbuf < 0)
                                {
-                                       print("url_single_fopen: out of memory in buf_create\n");
+                                       LOG_INFO("url_single_fopen: out of memory in buf_create\n");
                                        rdy(e, pass, URL_READY_ERROR);
                                        strunzone(e.url_url);
                                        remove(e);
@@ -132,7 +132,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                                        break;
                                        if(i >= autocvar__urllib_nextslot)
                                        {
-                                               print("url_single_fopen: too many concurrent requests\n");
+                                               LOG_INFO("url_single_fopen: too many concurrent requests\n");
                                                rdy(NULL, pass, URL_READY_ERROR);
                                                return;
                                        }
@@ -141,7 +141,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                // GET the data
                                if(!crypto_uri_postbuf(url, i + MIN_URL_ID, string_null, string_null, -1, 0))
                                {
-                                       print("url_single_fopen: failure in crypto_uri_postbuf\n");
+                                       LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf\n");
                                        rdy(NULL, pass, URL_READY_ERROR);
                                        return;
                                }
@@ -179,7 +179,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                rdy(e, pass, URL_READY_CANWRITE);
                                break;
                        case FILE_READ:
-                               print("url_single_fopen: cannot open '-' for reading\n");
+                               LOG_INFO("url_single_fopen: cannot open '-' for reading\n");
                                rdy(NULL, pass, URL_READY_ERROR);
                                break;
                }
@@ -235,7 +235,7 @@ void url_fclose(entity e)
                                                break;
                                if(i >= autocvar__urllib_nextslot)
                                {
-                                       print("url_fclose: too many concurrent requests\n");
+                                       LOG_INFO("url_fclose: too many concurrent requests\n");
                                        e.url_ready(e,e.url_ready_pass, URL_READY_ERROR);
                                        buf_del(e.url_wbuf);
                                        strunzone(e.url_url);
@@ -247,7 +247,7 @@ void url_fclose(entity e)
                        // POST the data
                        if(!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, "text/plain", "", e.url_wbuf, 0))
                        {
-                               print("url_fclose: failure in crypto_uri_postbuf\n");
+                               LOG_INFO("url_fclose: failure in crypto_uri_postbuf\n");
                                e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                                buf_del(e.url_wbuf);
                                strunzone(e.url_url);
@@ -328,7 +328,7 @@ void url_fputs(entity e, string s)
        else if(e.url_fh == URL_FH_STDOUT)
        {
                // stdout
-               print(s);
+               LOG_INFO(s);
        }
        else
        {
@@ -345,7 +345,7 @@ void url_multi_ready(entity fh, entity me, float status)
        {
                if(status == -422) // Unprocessable Entity
                {
-                       print("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
+                       LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
                        me.url_ready(fh, me.url_ready_pass, status);
                        strunzone(me.url_url);
                        remove(me);
@@ -371,7 +371,7 @@ void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass)
        n = tokenize_console(url);
        if(n <= 0)
        {
-               print("url_multi_fopen: need at least one URL\n");
+               LOG_INFO("url_multi_fopen: need at least one URL\n");
                rdy(NULL, pass, URL_READY_ERROR);
                return;
        }
index 3f3f72f5753f61a291966d325f64ea0481d53bd3..8b12a7b7ddbe6289b0f722ed661ab468a954a9ea 100644 (file)
@@ -16,21 +16,21 @@ void _dumptree_open(entity pass, entity me)
                s = me.classname;
        else
                s = strcat(me.classname, ": ", s);
-       print(_dumptree_space, etos(me), " (", s, ")");
+       LOG_INFO(_dumptree_space, etos(me), " (", s, ")");
        if(me.firstChild)
        {
-               print(" {\n");
+               LOG_INFO(" {\n");
                _dumptree_space = strcat(_dumptree_space, "  ");
        }
        else
-               print("\n");
+               LOG_INFO("\n");
 }
 void _dumptree_close(entity pass, entity me)
 {
        if(me.firstChild)
        {
                _dumptree_space = substring(_dumptree_space, 0, strlen(_dumptree_space) - 2);
-               print(_dumptree_space, "}\n");
+               LOG_INFO(_dumptree_space, "}\n");
        }
 }
 
@@ -43,11 +43,11 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "help" || argc == 0)
        {
-               print(_("Usage: menu_cmd command..., where possible commands are:\n"));
-               print(_("  sync - reloads all cvars on the current menu page\n"));
-               print(_("  directmenu ITEM - select a menu item as main item\n"));
+               LOG_INFO(_("Usage: menu_cmd command..., where possible commands are:\n"));
+               LOG_INFO(_("  sync - reloads all cvars on the current menu page\n"));
+               LOG_INFO(_("  directmenu ITEM - select a menu item as main item\n"));
 
-               print("\nGeneric commands shared by all programs:\n");
+               LOG_INFO("\nGeneric commands shared by all programs:\n");
                GenericCommand_macro_help();
 
                return;
@@ -76,7 +76,7 @@ void GameCommand(string theCommand)
 
                if(argc == 1)
                {
-                       print(_("Available options:\n"));
+                       LOG_INFO(_("Available options:\n"));
                        float i;
                        entity e;
                        string s;
@@ -91,7 +91,7 @@ void GameCommand(string theCommand)
                                                        continue;
                                                s = substring(s, strlen(filter), strlen(s) - strlen(filter));
                                        }
-                                       print(strcat(" ", s ,"\n"));
+                                       LOG_INFO(strcat(" ", s ,"\n"));
                                        ++i;
                                }
                }
@@ -130,5 +130,5 @@ void GameCommand(string theCommand)
                return;
        }
 
-       print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
+       LOG_INFO(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
index 2796c05706d0647662ebff6c4dafd88ac5c24b7b..7edc6eff50d8a4c172371d19c026e10fecba6b46 100644 (file)
@@ -281,7 +281,7 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the
 void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
 {
        if(theSize.x <= 0 || theSize.y <= 0) {
-               dprint("Drawing zero size text?\n");
+               LOG_TRACE("Drawing zero size text?\n");
                return;
        }
 
index 45a5a7fac44461aefa6e9e5984d0f1ae80a22050..e02642f69d54da9d134db6acb898c470c87a237f 100644 (file)
@@ -81,7 +81,7 @@ void Label_recalcPositionWithText(entity me, string t)
                        me.realOrigin_x = me.keepspaceLeft;
                if(!me.overrideCondenseFactor)
                        me.condenseFactor = spaceAvail / spaceUsed;
-               dprintf("NOTE: label text %s too wide for label, condensed by factor %f\n", t, me.condenseFactor);
+               LOG_TRACEF("NOTE: label text %s too wide for label, condensed by factor %f\n", t, me.condenseFactor);
        }
 
        if(!me.overrideRealOrigin_y)
index d01f6f7d4d0d2f986a288f1de66b2948219ba777..89966dde15a41a017a70e7fef9b09e8bc8c50c5e 100644 (file)
@@ -63,7 +63,7 @@ void m_init()
        cvar_set("_menu_prvm_language", prvm_language);
 
 #ifdef WATERMARK
-       dprintf("^4MQC Build information: ^1%s\n", WATERMARK);
+       LOG_TRACEF("^4MQC Build information: ^1%s\n", WATERMARK);
 #endif
 
        // list all game dirs (TEST)
@@ -76,7 +76,7 @@ void m_init()
                        s = getgamedirinfo(i, GETGAMEDIRINFO_NAME);
                        if (!s)
                                break;
-                       dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
+                       LOG_TRACE(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
                }
        }
 
@@ -252,7 +252,7 @@ void m_keyup (float key, float ascii)
                if(mouseButtonsPressed < 0)
                {
                        mouseButtonsPressed = 0;
-                       dprint("Warning: released an already released button\n");
+                       LOG_TRACE("Warning: released an already released button\n");
                }
        }
        if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
@@ -303,7 +303,7 @@ void m_keydown(float key, float ascii)
                if(mouseButtonsPressed > 10)
                {
                        mouseButtonsPressed = 10;
-                       dprint("Warning: pressed an already pressed button\n");
+                       LOG_TRACE("Warning: pressed an already pressed button\n");
                }
        }
        if(key == K_ALT) menuShiftState |= S_ALT;
index 10c81e7ef34bbec061df61789857970764025c1f..ebb622b0a1ecb89e9eb8c599362515576344a609 100644 (file)
@@ -20,7 +20,7 @@
 //#define SKINSTRING(name,def) case #name: break
 #define SKINSTRING(name,def) case #name: SKIN##name = strzone(_value); break
        // I know this leaks memory when skin is read multiple times. Screw it.
-#define SKINEND case "": break; case "//": break; default: dprint("Invalid key in skin file: ", key, "\n"); } }
+#define SKINEND case "": break; case "//": break; default: LOG_TRACE("Invalid key in skin file: ", key, "\n"); } }
 #include "skin-customizables.inc"
 #undef SKINEND
 #undef SKINSTRING
index a9379e7e83643a74d4c7d07fc0a3916cd47b4b00..843acad9082f9db87c3a828bbd70f145409eca3c 100644 (file)
@@ -345,7 +345,7 @@ void MapList_LoadMap(entity btn, entity me)
        m = MapInfo_BSPName_ByID(i);
        if (!m)
        {
-               print(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
+               LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
                me.refilter(me);
                return;
        }
@@ -358,7 +358,7 @@ void MapList_LoadMap(entity btn, entity me)
        }
        else
        {
-               print(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
+               LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
                me.refilter(me);
                return;
        }
index c72db26bbae9ab7c1730bbd2426714772e64352c..8aa5c105e895d097c955f787bb844b0349460848 100644 (file)
@@ -206,7 +206,7 @@ void RegisterSLCategories()
                                } \
                                else \
                                { \
-                                       printf( \
+                                       LOG_INFOF( \
                                                "RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
                                                s, \
                                                categories[i].cat_name \
@@ -373,7 +373,7 @@ int CheckCategoryForEntry(int entry)
                        case "cts":
                        case "xdf": { return CAT_DEFRAG; }
 
-                       default: { dprintf("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
+                       default: { LOG_TRACEF("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
                }
        }
 
index 1a5f754db83221e8f3e15bc8f55b788bb736097a..c849254e8b85c66a925a5f2d8bcdc28b1d285bbb 100644 (file)
@@ -111,7 +111,7 @@ void XonoticSkinList_getSkins(entity me)
                fh = fopen(language_filename(s), FILE_READ);
                if(fh < 0)
                {
-                       print("Warning: can't open skinvalues.txt file\n");
+                       LOG_INFO("Warning: can't open skinvalues.txt file\n");
                        continue;
                }
                while((s = fgets(fh)))
index b40488ef4b9b100247a672dce46ba1cd21549fb9..eabbaf16d5d5c6f376048a3df0bb51be1dcd2dbf 100644 (file)
@@ -98,7 +98,7 @@ void _TEST_XonoticDecibelsSlider()
                float v = fromDecibelOfSquare(db, -40);
                float dbv = toDecibelOfSquare(v, -40);
                float d = dbv - db;
-               printf("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
+               LOG_INFOF("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
                TEST_Check(fabs(d) > 0.02);
        }
        TEST_OK();
index 1857621b4902be90e9499c508a92c48328801c3c..93291ea1d35654fcea58258a24161c6a90ef1310 100644 (file)
@@ -57,8 +57,8 @@ float updateConwidths(float width, float height, float pixelheight)
 
        minfactor = min(1, 640 / c.x);            // can be > 1 only if c_x is <640
        maxfactor = max(1, r.x / c.x, r.y / c.y); // can be < 1 only if r_x < c_x and r_y < c_y
-       dprint("min factor: ", ftos(minfactor), "\n");
-       dprint("max factor: ", ftos(maxfactor), "\n");
+       LOG_TRACE("min factor: ", ftos(minfactor), "\n");
+       LOG_TRACE("max factor: ", ftos(maxfactor), "\n");
 
        if(sz < 0)
                f = 1 - (maxfactor - 1) * sz;
@@ -166,7 +166,7 @@ void XonoticResolutionSlider_loadResolutions(entity me, float fullscreen)
                r = getresolution(-1);
                if(r.x != 0 || r.y != 0)
                        me.addResolution(me, r.x, r.y, r.z);
-               dprint("Added system resolutions.\n");
+               LOG_TRACE("Added system resolutions.\n");
        }
 
        if(me.nValues == 0)
@@ -201,9 +201,9 @@ void XonoticResolutionSlider_loadResolutions(entity me, float fullscreen)
                me.addResolution(me, 1280, 960, 1); // pc res
                me.addResolution(me, 1280, 1024, 1); // pc res
                me.addResolution(me, 1920, 1080, 1); // 1080p
-               dprint("Added default resolutions.\n");
+               LOG_TRACE("Added default resolutions.\n");
        }
-       dprint("Total number of resolutions detected: ", ftos(me.nValues), "\n");
+       LOG_TRACE("Total number of resolutions detected: ", ftos(me.nValues), "\n");
 
        me.vid_fullscreen = fullscreen;
 
index 3c4b09e1463b6489ab69e04fa2bd2324b459a432..4a6e03f28e91c44314817782c3f0a20f5aa5576c 100644 (file)
@@ -81,7 +81,7 @@ string XonoticStatsList_convertDate(string input)
 
 void XonoticStatsList_getStats(entity me)
 {
-       dprint("XonoticStatsList_getStats() at time: ", ftos(time), "\n");
+       LOG_TRACE("XonoticStatsList_getStats() at time: ", ftos(time), "\n");
        // delete the old buffer if it exists
        if(me.listStats >= 0)
                buf_del(me.listStats);
index a5fa9da4760e89cea5a872aed9ef95e6ee9c0b8e..d2bf9c92023e67891226a2eef6d8a2ee4f8f1a32 100644 (file)
@@ -46,7 +46,7 @@ string getZonedTooltipForIdentifier(string s)
                if(t != "" && t != "custom cvar")
                        return strzone(t);
        }
-       dprint("WARNING: no tooltip set for ", s, "\n");
+       LOG_TRACE("WARNING: no tooltip set for ", s, "\n");
        return string_null;
 }
 
@@ -303,7 +303,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               printf("Received HTTP request data for an invalid id %d.\n", id);
+               LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
        }
 }
 
@@ -318,22 +318,22 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
 
        if(_Nex_ExtResponseSystem_UpdateTo)
        {
-               dprint("error: UpdateNotification_URI_Get_Callback has been called before\n");
+               LOG_TRACE("error: UpdateNotification_URI_Get_Callback has been called before\n");
                return;
        }
        if(status != 0)
        {
-               dprintf("error receiving update notification: status is %d\n", status);
+               LOG_TRACEF("error receiving update notification: status is %d\n", status);
                return;
        }
        if(substring(data, 0, 1) == "<")
        {
-               dprint("error: received HTML instead of an update notification\n");
+               LOG_TRACE("error: received HTML instead of an update notification\n");
                return;
        }
        if(strstrofs(data, "\r", 0) != -1)
        {
-               dprint("error: received carriage returns from update notification server\n");
+               LOG_TRACE("error: received carriage returns from update notification server\n");
                return;
        }
 
@@ -411,7 +411,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                {
                        // update needed
                        _Nex_ExtResponseSystem_UpdateTo = strzone(un_version);
-                       if(un_download) { printf(_("Update can be downloaded at:\n%s\n"), un_download); }
+                       if(un_download) { LOG_INFOF(_("Update can be downloaded at:\n%s\n"), un_download); }
                        if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); }
                        DisableServerBackwardsCompatibility();
                }
@@ -642,7 +642,7 @@ float updateCompression()
                cvar_set("gl_texturecompression", "1");
                cvar_set("r_texture_dds_load", "1");
                if(!can_dds)
-                       print(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
+                       LOG_INFO(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
                return 0;
        }
        else
@@ -809,7 +809,7 @@ void CheckSendCvars(entity me, string cvarnamestring)
 {
        if(me.sendCvars)
        {
-               printf("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring));
+               LOG_INFOF("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring));
                if(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
                {
                        cmd(sprintf("\nsendcvar %s\n", cvarnamestring));
index 6ec1756ed643851ff2ed574822960e63a2e798f3..f874b616b25a8045311c028bf9abde739d1f84e7 100644 (file)
@@ -1,4 +1,4 @@
-void dprint(string s, ...) = #25;
+void LOG_TRACE(string s, ...) = #25;
 string ftos(float f) = #26;
 string vtos(vector v) = #27;
 void error(string e) = #10;
@@ -7,7 +7,7 @@ float test();
 void spawnfunc_worldspawn()
 {
        float r;
-       dprint("TESTCASE: START\n");
+       LOG_TRACE("TESTCASE: START\n");
        r = test();
        if(r == 1)
                error("TESTCASE: PASS");
index e0dbdae26875b5537345ccd77ad359ec56998e45..5549778be82c2f50ce7928b3e5fe5e6bd6f52557 100644 (file)
@@ -343,12 +343,12 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        shotspeedupward *= W_WeaponSpeedFactor();
        if (!shotspeed)
        {
-               dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
+               LOG_TRACE("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
                shotspeed = 1000000;
        }
        if (!maxshottime)
        {
-               dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
+               LOG_TRACE("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
                maxshottime = 1;
        }
        makevectors(self.v_angle);
index e42a50f6d4a9ccb8abad44d3b3db2511a13a06a6..64f5eb7d4ce3a026c7175631066dac3ae202419b 100644 (file)
@@ -156,7 +156,7 @@ void bot_setnameandstuff()
 
        if(file < 0)
        {
-               print(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
+               LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
                readfile = "";
        }
        else
@@ -383,7 +383,7 @@ void bot_relinkplayerlist()
                }
                e = e.chain;
        }
-       dprint(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
+       LOG_TRACE(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
        bot_strategytoken = bot_list;
        bot_strategytoken_taken = true;
 }
@@ -524,18 +524,18 @@ void autoskill(float factor)
                        bestbot = max(bestbot, head.totalfrags - head.totalfrags_lastcheck);
        }
 
-       dprint("autoskill: best player got ", ftos(bestplayer), ", ");
-       dprint("best bot got ", ftos(bestbot), "; ");
+       LOG_TRACE("autoskill: best player got ", ftos(bestplayer), ", ");
+       LOG_TRACE("best bot got ", ftos(bestbot), "; ");
        if(bestbot < 0 || bestplayer < 0)
        {
-               dprint("not doing anything\n");
+               LOG_TRACE("not doing anything\n");
                // don't return, let it reset all counters below
        }
        else if(bestbot <= bestplayer * factor - 2)
        {
                if(autocvar_skill < 17)
                {
-                       dprint("2 frags difference, increasing skill\n");
+                       LOG_TRACE("2 frags difference, increasing skill\n");
                        cvar_set("skill", ftos(autocvar_skill + 1));
                        bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
                }
@@ -544,14 +544,14 @@ void autoskill(float factor)
        {
                if(autocvar_skill > 0)
                {
-                       dprint("2 frags difference, decreasing skill\n");
+                       LOG_TRACE("2 frags difference, decreasing skill\n");
                        cvar_set("skill", ftos(autocvar_skill - 1));
                        bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
                }
        }
        else
        {
-               dprint("not doing anything\n");
+               LOG_TRACE("not doing anything\n");
                return;
                // don't reset counters, wait for them to accumulate
        }
index fcf1c04d29cda938cd5f8e3454bf1fc2150a13e7..5796fe60163346a5023ede6a39b4b560dc6bfa88 100644 (file)
@@ -537,7 +537,7 @@ void havocbot_movetogoal()
                                threshold = maxspeed * 0.2;
                                if(sxy < threshold)
                                {
-                                       dprint("Warning: ", self.netname, " got stuck on a jumppad (velocity in xy is ", ftos(sxy), "), trying to get out of it now\n");
+                                       LOG_TRACE("Warning: ", self.netname, " got stuck on a jumppad (velocity in xy is ", ftos(sxy), "), trying to get out of it now\n");
                                        self.aistatus |= AI_STATUS_OUT_JUMPPAD;
                                }
                                return;
@@ -788,7 +788,7 @@ void havocbot_movetogoal()
                                                if(tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos))
                                                {
                                                        // Remove dangerous dynamic goals from stack
-                                                       dprint("bot ", self.netname, " avoided the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it led to a dangerous path; goal stack cleared\n");
+                                                       LOG_TRACE("bot ", self.netname, " avoided the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it led to a dangerous path; goal stack cleared\n");
                                                        navigation_clearroute();
                                                        return;
                                                }
@@ -1117,7 +1117,7 @@ float havocbot_moveto(vector pos)
                // Step 4: Move to waypoint
                if(self.havocbot_personal_waypoint==world)
                {
-                       dprint("Error: ", self.netname, " trying to walk to a non existent personal waypoint\n");
+                       LOG_TRACE("Error: ", self.netname, " trying to walk to a non existent personal waypoint\n");
                        self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                        return CMD_STATUS_ERROR;
                }
@@ -1128,7 +1128,7 @@ float havocbot_moveto(vector pos)
                        bot_strategytoken_taken = true;
                        if(havocbot_moveto_refresh_route())
                        {
-                               dprint(self.netname, " walking to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts)\n");
+                               LOG_TRACE(self.netname, " walking to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts)\n");
                                self.havocbot_personal_waypoint_searchtime = time + 10;
                                self.havocbot_personal_waypoint_failcounter = 0;
                        }
@@ -1138,13 +1138,13 @@ float havocbot_moveto(vector pos)
                                self.havocbot_personal_waypoint_searchtime = time + 2;
                                if(self.havocbot_personal_waypoint_failcounter >= 30)
                                {
-                                       dprint("Warning: can't walk to the personal waypoint located at ", vtos(self.havocbot_personal_waypoint.origin),"\n");
+                                       LOG_TRACE("Warning: can't walk to the personal waypoint located at ", vtos(self.havocbot_personal_waypoint.origin),"\n");
                                        self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
                                        remove(self.havocbot_personal_waypoint);
                                        return CMD_STATUS_ERROR;
                                }
                                else
-                                       dprint(self.netname, " can't walk to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts), trying later\n");
+                                       LOG_TRACE(self.netname, " can't walk to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts), trying later\n");
                        }
                }
 
@@ -1162,7 +1162,7 @@ float havocbot_moveto(vector pos)
                if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_REACHED)
                {
                        // Step 5: Waypoint reached
-                       dprint(self.netname, "'s personal waypoint reached\n");
+                       LOG_TRACE(self.netname, "'s personal waypoint reached\n");
                        remove(self.havocbot_personal_waypoint);
                        self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_REACHED;
                        return CMD_STATUS_FINISHED;
@@ -1177,7 +1177,7 @@ float havocbot_moveto(vector pos)
                // Wait until it is linked
                if(!self.havocbot_personal_waypoint.wplinked)
                {
-                       dprint(self.netname, " waiting for personal waypoint to be linked\n");
+                       LOG_TRACE(self.netname, " waiting for personal waypoint to be linked\n");
                        return CMD_STATUS_EXECUTING;
                }
 
@@ -1186,7 +1186,7 @@ float havocbot_moveto(vector pos)
                self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_GOING;
 
                // Step 3: Route to waypoint
-               dprint(self.netname, " walking to its personal waypoint\n");
+               LOG_TRACE(self.netname, " walking to its personal waypoint\n");
 
                return CMD_STATUS_EXECUTING;
        }
@@ -1195,7 +1195,7 @@ float havocbot_moveto(vector pos)
        wp = waypoint_spawnpersonal(pos);
        if(wp==world)
        {
-               dprint("Error: Can't spawn personal waypoint at ",vtos(pos),"\n");
+               LOG_TRACE("Error: Can't spawn personal waypoint at ",vtos(pos),"\n");
                return CMD_STATUS_ERROR;
        }
 
index ea163f4efb56cdd0f9e67b339206573fbe48cedf..63888e45fc5f8d81af0ccf7734f91f02ce620b04 100644 (file)
@@ -50,7 +50,7 @@ void havocbot_role_kh_carrier()
 
        if (!(self.kh_next))
        {
-               dprint("changing role to freelancer\n");
+               LOG_TRACE("changing role to freelancer\n");
                self.havocbot_role = havocbot_role_kh_freelancer;
                self.havocbot_role_timeout = 0;
                return;
@@ -77,7 +77,7 @@ void havocbot_role_kh_defense()
 
        if (self.kh_next)
        {
-               dprint("changing role to carrier\n");
+               LOG_TRACE("changing role to carrier\n");
                self.havocbot_role = havocbot_role_kh_carrier;
                self.havocbot_role_timeout = 0;
                return;
@@ -87,7 +87,7 @@ void havocbot_role_kh_defense()
                self.havocbot_role_timeout = time + random() * 10 + 20;
        if (time > self.havocbot_role_timeout)
        {
-               dprint("changing role to freelancer\n");
+               LOG_TRACE("changing role to freelancer\n");
                self.havocbot_role = havocbot_role_kh_freelancer;
                self.havocbot_role_timeout = 0;
                return;
@@ -118,7 +118,7 @@ void havocbot_role_kh_offense()
 
        if (self.kh_next)
        {
-               dprint("changing role to carrier\n");
+               LOG_TRACE("changing role to carrier\n");
                self.havocbot_role = havocbot_role_kh_carrier;
                self.havocbot_role_timeout = 0;
                return;
@@ -128,7 +128,7 @@ void havocbot_role_kh_offense()
                self.havocbot_role_timeout = time + random() * 10 + 20;
        if (time > self.havocbot_role_timeout)
        {
-               dprint("changing role to freelancer\n");
+               LOG_TRACE("changing role to freelancer\n");
                self.havocbot_role = havocbot_role_kh_freelancer;
                self.havocbot_role_timeout = 0;
                return;
@@ -160,7 +160,7 @@ void havocbot_role_kh_freelancer()
 
        if (self.kh_next)
        {
-               dprint("changing role to carrier\n");
+               LOG_TRACE("changing role to carrier\n");
                self.havocbot_role = havocbot_role_kh_carrier;
                self.havocbot_role_timeout = 0;
                return;
@@ -172,12 +172,12 @@ void havocbot_role_kh_freelancer()
        {
                if (random() < 0.5)
                {
-                       dprint("changing role to offense\n");
+                       LOG_TRACE("changing role to offense\n");
                        self.havocbot_role = havocbot_role_kh_offense;
                }
                else
                {
-                       dprint("changing role to defense\n");
+                       LOG_TRACE("changing role to defense\n");
                        self.havocbot_role = havocbot_role_kh_defense;
                }
                self.havocbot_role_timeout = 0;
index bfa8f8436c3e5c30d47894ae5d0b51fa75806039..593488e4425e96259e15a2d2b228d0c7223da452 100644 (file)
@@ -239,7 +239,7 @@ void havocbot_chooserole_dm()
 
 void havocbot_chooserole()
 {
-       dprint("choosing a role...\n");
+       LOG_TRACE("choosing a role...\n");
        self.bot_strategytime = 0;
        if (MUTATOR_CALLHOOK(HavocBot_ChooseRole, self))
                return;
index ad0a8d761d4bdfff7a8aca640ebc8c6ddf8b8d51..72729ec8671bdbcf8a264295188ba89531f00b7d 100644 (file)
@@ -13,8 +13,8 @@ void bot_debug(string input)
 {
        switch(autocvar_bot_debug)
        {
-               case 1: dprint(input); break;
-               case 2: print(input); break;
+               case 1: LOG_TRACE(input); break;
+               case 2: LOG_INFO(input); break;
        }
 }
 
index b1425c1a821dadaf447b5d291c539079e3fc83bb..a8dc92171746325702c23c1676d26bfd78c53fab 100644 (file)
@@ -14,7 +14,7 @@ void bot_clearqueue(entity bot)
                return;
        buf_del(bot.bot_cmdqueuebuf);
        bot.bot_cmdqueuebuf_allocated = false;
-       dprint("bot ", bot.netname, " queue cleared\n");
+       LOG_TRACE("bot ", bot.netname, " queue cleared\n");
 }
 
 void bot_queuecommand(entity bot, string cmdstring)
@@ -123,7 +123,7 @@ entity bot_getplace(string placename)
                }
                e = find(world, targetname, s);
                if(!e)
-                       print("invalid place ", s, "\n");
+                       LOG_INFO("invalid place ", s, "\n");
                if(i < MAX_BOT_PLACES)
                {
                        self.(bot_placenames[i]) = strzone(placename);
@@ -136,7 +136,7 @@ entity bot_getplace(string placename)
        {
                e = find(world, targetname, placename);
                if(!e)
-                       print("invalid place ", placename, "\n");
+                       LOG_INFO("invalid place ", placename, "\n");
                return e;
        }
 }
@@ -292,7 +292,7 @@ float bot_decodecommand(string cmdstring)
 
                if(cmd_parm_type!=BOT_CMD_PARAMETER_NONE&&parm=="")
                {
-                       print("ERROR: A parameter is required for this command\n");
+                       LOG_INFO("ERROR: A parameter is required for this command\n");
                        return 0;
                }
 
@@ -318,7 +318,7 @@ float bot_decodecommand(string cmdstring)
                }
                return 1;
        }
-       print("ERROR: No such command '", cmdstring, "'\n");
+       LOG_INFO("ERROR: No such command '", cmdstring, "'\n");
        return 0;
 }
 
@@ -353,87 +353,87 @@ void bot_cmdhelp(string scmd)
                                break;
                }
 
-               print(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
+               LOG_INFO(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
 
-               print("Description: ");
+               LOG_INFO("Description: ");
                switch(i)
                {
                        case BOT_CMD_PAUSE:
-                               print("Stops the bot completely. Any command other than 'continue' will be ignored.");
+                               LOG_INFO("Stops the bot completely. Any command other than 'continue' will be ignored.");
                                break;
                        case BOT_CMD_CONTINUE:
-                               print("Disable paused status");
+                               LOG_INFO("Disable paused status");
                                break;
                        case BOT_CMD_WAIT:
-                               print("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
+                               LOG_INFO("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_WAIT_UNTIL:
-                               print("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
+                               LOG_INFO("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_BARRIER:
-                               print("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
+                               LOG_INFO("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_TURN:
-                               print("Look to the right or left N degrees. For turning to the left use positive numbers.");
+                               LOG_INFO("Look to the right or left N degrees. For turning to the left use positive numbers.");
                                break;
                        case BOT_CMD_MOVETO:
-                               print("Walk to an specific coordinate on the map. Usage: moveto \"x y z\"");
+                               LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \"x y z\"");
                                break;
                        case BOT_CMD_MOVETOTARGET:
-                               print("Walk to the specific target on the map");
+                               LOG_INFO("Walk to the specific target on the map");
                                break;
                        case BOT_CMD_RESETGOAL:
-                               print("Resets the goal stack");
+                               LOG_INFO("Resets the goal stack");
                                break;
                        case BOT_CMD_CC:
-                               print("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
+                               LOG_INFO("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
                                break;
                        case BOT_CMD_IF:
-                               print("Perform simple conditional execution.\n");
-                               print("Syntax: \n");
-                               print("        sv_cmd .. if \"condition\"\n");
-                               print("        sv_cmd ..        <instruction if true>\n");
-                               print("        sv_cmd ..        <instruction if true>\n");
-                               print("        sv_cmd .. else\n");
-                               print("        sv_cmd ..        <instruction if false>\n");
-                               print("        sv_cmd ..        <instruction if false>\n");
-