Logging: tidy
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 27 Aug 2017 02:37:32 +0000 (12:37 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 27 Aug 2017 02:37:32 +0000 (12:37 +1000)
28 files changed:
qcsrc/client/commands/cl_cmd.qc
qcsrc/common/command/generic.qc
qcsrc/common/command/rpn.qc
qcsrc/common/debug.qh
qcsrc/common/effects/effectinfo.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/items/all.qh
qcsrc/common/mutators/mutator/sandbox/sv_sandbox.qc
qcsrc/common/notifications/all.qh
qcsrc/common/playerstats.qc
qcsrc/common/turrets/all.qh
qcsrc/common/turrets/config.qc
qcsrc/common/util.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/lib/log.qh
qcsrc/menu/command/menu_cmd.qc
qcsrc/server/bot/default/bot.qc
qcsrc/server/bot/default/scripting.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/command/banning.qc
qcsrc/server/command/common.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/ipban.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/sv_main.qc

index 6777eef..6de891e 100644 (file)
@@ -59,7 +59,7 @@ void LocalCommand_blurtest(int request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
+                       LOG_INFO("Usage:^3 cl_cmd blurtest\n");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -109,7 +109,7 @@ void LocalCommand_boxparticles(int request, int argc)
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
+                       LOG_INFO("Usage:^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");
@@ -160,7 +160,7 @@ void LocalCommand_create_scrshot_ent(int request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent [path]\n");
+                       LOG_INFO("Usage:^3 cl_cmd create_scrshot_ent [path]\n");
                        LOG_INFO("  Where 'path' can be the subdirectory of data/data in which the file is saved.\n");
                        return;
                }
@@ -190,7 +190,7 @@ void LocalCommand_debugmodel(int request, int argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
+                       LOG_INFO("Usage:^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;
                }
@@ -240,7 +240,7 @@ void LocalCommand_handlevote(int request, int argc)
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
+                       LOG_INFO("Usage:^3 cl_cmd handlevote vote\n");
                        LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
                        return;
                }
@@ -341,7 +341,7 @@ void LocalCommand_hud(int request, int argc)
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
+                       LOG_INFO("Usage:^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");
@@ -372,7 +372,7 @@ void LocalCommand_localprint(int request, int argc)
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
+                       LOG_INFO("Usage:^3 cl_cmd localprint \"message\"\n");
                        LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
                        return;
                }
@@ -399,7 +399,7 @@ void LocalCommand_mv_download(int request, int argc)
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
+                       LOG_INFO("Usage:^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;
                }
@@ -436,7 +436,7 @@ void LocalCommand_sendcvar(int request, int argc)
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
+                       LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>\n");
                        LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
                        return;
                }
@@ -531,7 +531,7 @@ void GameCommand(string command)
        {
                if (argc == 1)
                {
-                       LOG_INFO("\nClient console commands:\n");
+                       LOG_INFO("Client console commands:\n");
                        LocalCommand_macro_help();
 
                        LOG_INFO("\nGeneric commands shared by all programs:\n");
index a9abd98..9b4cdfe 100644 (file)
@@ -89,7 +89,7 @@ void GenericCommand_addtolist(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
+                       LOG_INFO("Usage:^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;
@@ -163,7 +163,7 @@ void GenericCommand_qc_curl(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]");
                        return;
                }
        }
@@ -217,7 +217,7 @@ GENERIC_COMMAND(dumpcommands, "Dump all commands on the program to *_cmd_dump.tx
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpcommands");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -298,7 +298,7 @@ void GenericCommand_maplist(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2maplist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
+                       LOG_INFO("Usage:^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");
@@ -320,7 +320,7 @@ void GenericCommand_nextframe(float request, float arguments, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n");
                        LOG_INFO("  Where command will be executed next frame of this VM\n");
                        return;
                }
@@ -354,7 +354,7 @@ void GenericCommand_removefromlist(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
+                       LOG_INFO("Usage:^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;
@@ -403,7 +403,7 @@ void GenericCommand_restartnotifs(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " restartnotifs");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -433,7 +433,7 @@ void GenericCommand_settemp(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2settemp^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
+                       LOG_INFO("Usage:^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;
@@ -460,7 +460,7 @@ void GenericCommand_settemp_restore(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2settemp^7\n");
                        return;
@@ -488,7 +488,7 @@ void GenericCommand_runtest(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
                        return;
                }
        }
index 828fbdf..257972f 100644 (file)
@@ -563,7 +563,7 @@ LABEL(skip_difference)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
+                       LOG_INFO("Usage:^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");
index 28153a7..7fee425 100644 (file)
@@ -177,7 +177,7 @@ bool autocvar_debugdraw;
                        default:
                        case CMD_REQUEST_USAGE:
                        {
-                               LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv"));
+                               LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv");
                                return;
                        }
                }
@@ -201,7 +201,7 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object")
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index");
                        return;
                }
        }
@@ -219,7 +219,7 @@ GENERIC_COMMAND(version, "Print the current version")
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " version"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " version");
                        return;
                }
        }
@@ -253,7 +253,7 @@ GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars")
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges");
                        return;
                }
        }
@@ -340,7 +340,7 @@ GENERIC_COMMAND(find, "Search through entities for matching classname")
         }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 " GetProgramCommandPrefix() " find classname\n");
+                       LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " find classname\n");
                        LOG_INFO("  Where 'classname' is the classname to search for.\n");
                        return;
                }
@@ -362,7 +362,7 @@ GENERIC_COMMAND(findat, "Search through entities for matching origin")
                        LOG_INFO("Incorrect parameters for ^2findat^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"\n");
+                       LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"\n");
                        return;
                }
        }
index f662aee..aa523c2 100644 (file)
@@ -313,7 +313,7 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
         }
         default:
         case CMD_REQUEST_USAGE: {
-            LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]"));
+            LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]");
             LOG_INFO("  Where 'filename' is the file to write (default is effectinfo_dump.txt),\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");
index ba42962..6be1d95 100644 (file)
@@ -119,14 +119,16 @@ void relocate_nexball(entity this)
        tracebox(this.origin, BALL_MINS, BALL_MAXS, this.origin, true, this);
        if(trace_startsolid)
        {
-               vector o;
-               o = this.origin;
-               if(!move_out_of_solid(this))
+               vector o = this.origin;
+               if (!move_out_of_solid(this)) {
                        objerror(this, "could not get out of solid at all!");
-               LOG_INFO("^1NOTE: this map needs FIXING. ", this.classname, " at ", vtos(o - '0 0 1'));
-               LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
-               LOG_INFO(" ", ftos(this.origin.y - o.y));
-               LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+        }
+        LOG_INFOF(
+            "^1NOTE: this map needs FIXING. %s at %s needs to be moved out of solid, e.g. by %s",
+            this.classname,
+            vtos(o - '0 0 1'),
+            vtos(this.origin - o)
+        );
                this.origin = o;
        }
 }
index 14c5a34..623f71b 100644 (file)
@@ -26,7 +26,7 @@ GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
         }
         default:
         case CMD_REQUEST_USAGE: {
-            LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+            LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
             return;
         }
     }
index 0fd58c6..883a01e 100644 (file)
@@ -407,7 +407,7 @@ void sandbox_Database_Load()
        if(file_get < 0)
        {
                if(autocvar_g_sandbox_info > 0)
-                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded\n"));
+                       LOG_INFO("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded\n");
        }
        else
        {
@@ -432,7 +432,7 @@ void sandbox_Database_Load()
                        }
                }
                if(autocvar_g_sandbox_info > 0)
-                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name, "\n"));
+                       LOG_INFO("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name, "\n");
        }
        fclose(file_get);
 }
@@ -524,7 +524,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                _setmodel(e, argv(2));
 
                                if(autocvar_g_sandbox_info > 0)
-                                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
+                                       LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " spawned an object at origin ^3", vtos(e.origin), "\n");
                                return true;
 
                        // ---------------- COMMAND: OBJECT, REMOVE ----------------
@@ -533,7 +533,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                if(e != NULL)
                                {
                                        if(autocvar_g_sandbox_info > 0)
-                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
+                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin), "\n");
                                        sandbox_ObjectRemove(e);
                                        return true;
                                }
@@ -582,7 +582,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
 
                                                print_to(player, "^2SANDBOX - INFO: ^7Object pasted successfully");
                                                if(autocvar_g_sandbox_info > 0)
-                                                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
+                                                       LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " pasted an object at origin ^3", vtos(e.origin), "\n");
                                                return true;
                                }
                                return true;
@@ -617,7 +617,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                                        player.object_attach = NULL; // object was attached, no longer keep it scheduled for attachment
                                                        print_to(player, "^2SANDBOX - INFO: ^7Object attached successfully");
                                                        if(autocvar_g_sandbox_info > 1)
-                                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
+                                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin), "\n");
                                                        return true;
                                                }
                                                print_to(player, "^1SANDBOX - WARNING: ^7Object could not be attached to the parent. Make sure you are facing an object that you have edit rights over");
@@ -630,7 +630,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                                        sandbox_ObjectAttach_Remove(e);
                                                        print_to(player, "^2SANDBOX - INFO: ^7Child objects detached successfully");
                                                        if(autocvar_g_sandbox_info > 1)
-                                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " detached objects at origin ^3", vtos(e.origin), "\n"));
+                                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " detached objects at origin ^3", vtos(e.origin), "\n");
                                                        return true;
                                                }
                                                print_to(player, "^1SANDBOX - WARNING: ^7Child objects could not be detached. Make sure you are facing an object that you have edit rights over");
@@ -721,7 +721,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                        e.message2 = strzone(strftime(true, "%d-%m-%Y %H:%M:%S"));
 
                                        if(autocvar_g_sandbox_info > 1)
-                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
+                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n");
                                        return true;
                                }
 
index 4cc59a5..36bf248 100644 (file)
@@ -196,7 +196,7 @@ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt"
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+                       LOG_INFO("Usage:^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");
index 0015da7..4e0ffe6 100644 (file)
@@ -613,7 +613,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)
        {
-               LOG_INFO(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
+               LOG_INFOF("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e)));
                ++i;
        }
 #endif
@@ -792,13 +792,13 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                }
 
                                #if 0
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "PlayerStats_PlayerDetail_Handler(): "
                                        "Key '%s', Event '%s', Data '%s'\n",
                                        key,
                                        event,
                                        data
-                               ));
+                               );
                                #endif
                        }
                        //print("PlayerStats_PlayerDetail_Handler(): End of response.\n");
index 8bd0b14..7160c2f 100644 (file)
@@ -38,14 +38,14 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
             if(tur_config_file >= 0)
             {
                 Dump_Turret_Settings();
-                LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
+                LOG_INFOF("Dumping turrets... File located in ^2data/data/%s^7.\n", filename);
                 fclose(tur_config_file);
                 tur_config_file = -1;
                 tur_config_alsoprint = -1;
             }
             else
             {
-                LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
             }
             #else
             LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
@@ -56,7 +56,7 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
         default:
         case CMD_REQUEST_USAGE:
         {
-            LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
+            LOG_INFO("Usage:^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");
index a5a23f9..0d745b9 100644 (file)
@@ -50,7 +50,7 @@ void Dump_Turret_Settings()
                TUR_CONFIG_WRITETOFILE("// }}}\n")
 
                // step 5: debug info
-               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.turret_name, TUR_CONFIG_COUNT));
+               LOG_INFOF("#%d: %s: %d settings...\n", i, it.turret_name, TUR_CONFIG_COUNT);
                totalsettings += TUR_CONFIG_COUNT;
        });
 
@@ -60,7 +60,7 @@ void Dump_Turret_Settings()
                config_queue[j] = string_null;
 
        // extra information
-       LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
+       LOG_INFOF("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings);
 }
 
 #endif
index 6340c00..81eb774 100644 (file)
@@ -336,17 +336,19 @@ STATIC_INIT(compressShortVector)
 
        if(cvar("developer"))
        {
-               LOG_INFO("Verifying vector compression table...\n");
+               LOG_INFO("Verifying vector compression table...");
                for(i = 0x0F00; i < 0xFFFF; ++i)
                        if(i != compressShortVector(decompressShortVector(i)))
                        {
-                               LOG_INFO("BROKEN vector compression: ", ftos(i));
-                               LOG_INFO(" -> ", vtos(decompressShortVector(i)));
-                               LOG_INFO(" -> ", ftos(compressShortVector(decompressShortVector(i))));
-                               LOG_INFO("\n");
+                               LOG_INFOF(
+                                   "BROKEN vector compression: %s -> %s -> %s",
+                                   ftos(i),
+                                   vtos(decompressShortVector(i)),
+                                   ftos(compressShortVector(decompressShortVector(i)))
+                );
                                error("b0rk");
                        }
-               LOG_INFO("Done.\n");
+               LOG_INFO("Done.");
        }
 }
 
index 0d595df..32f136d 100644 (file)
@@ -643,7 +643,7 @@ CLIENT_COMMAND(weapon_find, "Show spawn locations of a weapon")
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd weapon_find weapon\n");
+                       LOG_INFO("Usage:^3 cl_cmd weapon_find weapon\n");
                        LOG_INFO("  Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.\n");
                        return;
                }
index c88e3a7..26cf121 100644 (file)
@@ -64,14 +64,14 @@ GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPON
             if(wep_config_file >= 0)
             {
                 Dump_Weapon_Settings();
-                LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
+                LOG_INFOF("Dumping weapons... File located in ^2data/data/%s^7.\n", filename);
                 fclose(wep_config_file);
                 wep_config_file = -1;
                 wep_config_alsoprint = -1;
             }
             else
             {
-                LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
             }
             #else
             LOG_INFO(_("Weapons dump command only works with sv_cmd.\n"));
@@ -82,7 +82,7 @@ GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPON
         default:
         case CMD_REQUEST_USAGE:
         {
-            LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
+            LOG_INFO("Usage:^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");
index a819477..d13587c 100644 (file)
@@ -48,7 +48,7 @@ void Dump_Weapon_Settings()
                WEP_CONFIG_WRITETOFILE("// }}}\n");
 
                // step 5: debug info
-               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.m_name, WEP_CONFIG_COUNT));
+               LOG_INFOF("#%d: %s: %d settings...\n", i, it.m_name, WEP_CONFIG_COUNT);
                totalweapons += 1;
                totalsettings += WEP_CONFIG_COUNT;
        });
@@ -59,5 +59,5 @@ void Dump_Weapon_Settings()
                config_queue[x] = string_null;
 
        // extra information
-       LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", totalweapons, totalsettings));
+       LOG_INFOF("Totals: %d weapons, %d settings\n", totalweapons, totalsettings);
 }
index b190cce..8b976e2 100644 (file)
@@ -110,14 +110,14 @@ void W_Shockwave_Melee_Think(entity this)
                                { accuracy_add(this.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
 
                        #ifdef DEBUG_SHOCKWAVE
-                       LOG_INFO(sprintf(
+                       LOG_INFOF(
                                "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
                                this.realowner.netname,
                                target_victim.netname,
                                swing_damage,
                                swing_factor,
                                time
-                       ));
+                       );
                        #endif
 
                        // allow multiple hits with one swing, but not against the same player twice
@@ -397,7 +397,7 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                );
 
                                #ifdef DEBUG_SHOCKWAVE
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "SELF HIT: multiplier = %f, damage = %f, force = %f... "
                                        "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
                                        multiplier,
@@ -405,7 +405,7 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                        vlen(final_force),
                                        multiplier_from_accuracy,
                                        multiplier_from_distance
-                               ));
+                               );
                                #endif
                        }
                        else if(distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
@@ -460,7 +460,7 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
 
                                #ifdef DEBUG_SHOCKWAVE
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
                                        "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
                                        multiplier,
@@ -468,7 +468,7 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                        vlen(final_force),
                                        multiplier_from_accuracy,
                                        multiplier_from_distance
-                               ));
+                               );
                                #endif
                        }
                }
@@ -549,7 +549,7 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
 
                                #ifdef DEBUG_SHOCKWAVE
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
                                        "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
                                        multiplier,
@@ -557,7 +557,7 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                        vlen(final_force),
                                        multiplier_from_accuracy,
                                        multiplier_from_distance
-                               ));
+                               );
                                #endif
                        }
                }
@@ -584,12 +584,12 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                        accuracy_add(actor, WEP_SHOCKWAVE.m_id, 0, final_damage);
 
                #ifdef DEBUG_SHOCKWAVE
-               LOG_INFO(sprintf(
+               LOG_INFOF(
                        "SHOCKWAVE by %s: damage = %f, force = %f.\n",
                        actor.netname,
                        final_damage,
                        vlen(final_force)
-               ));
+               );
                #endif
 
                shockwave_hit[i-1] = NULL;
index 7f5bc72..7491818 100644 (file)
@@ -69,7 +69,10 @@ string(string, string...) strcat1n = #115;
 #define _LOG_INFO(s) \
        MACRO_BEGIN { \
                dprint(_LOG_HEADER("^5INFO")); \
-               print("\n^7", s); \
+               string __s = s; \
+               print("\n^7", __s); \
+               /* TODO: unconditionally add a newline when possible */ \
+               if (str2chr(__s, strlen(__s) - 1) != '\n') { print("\n"); } \
        } MACRO_END
 
 #define  LOG_TRACE(...) _LOG_TRACE(strcat1n(__VA_ARGS__))
index 72aadf6..8859b40 100644 (file)
@@ -16,15 +16,15 @@ void _dumptree_open(entity pass, entity me)
        s = me.toString(me);
        if (s == "") s = me.classname;
        else s = strcat(me.classname, ": ", s);
-       LOG_INFO(_dumptree_space, etos(me), " (", s, ")");
+       print(_dumptree_space, etos(me), " (", s, ")");
        if (me.firstChild)
        {
-               LOG_INFO(" {\n");
+               print(" {\n");
                _dumptree_space = strcat(_dumptree_space, "  ");
        }
        else
        {
-               LOG_INFO("\n");
+               print("\n");
        }
 }
 void _dumptree_close(entity pass, entity me)
@@ -32,7 +32,7 @@ void _dumptree_close(entity pass, entity me)
        if (me.firstChild)
        {
                _dumptree_space = substring(_dumptree_space, 0, strlen(_dumptree_space) - 2);
-               LOG_INFO(_dumptree_space, "}\n");
+               print(_dumptree_space, "}\n");
        }
 }
 
@@ -49,7 +49,7 @@ void GameCommand(string theCommand)
                LOG_INFO(_("  sync - reloads all cvars on the current menu page\n"));
                LOG_INFO(_("  directmenu ITEM - select a menu item as main item\n"));
 
-               LOG_INFO("\nGeneric commands shared by all programs:\n");
+               LOG_INFO("Generic commands shared by all programs:\n");
                GenericCommand_macro_help();
 
                return;
index 5bc86b8..0e6c87b 100644 (file)
@@ -166,7 +166,7 @@ void bot_setnameandstuff(entity this)
 
        if(file < 0)
        {
-               LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
+               LOG_INFOF("Error: Can not open the bot configuration file '%s'", autocvar_bot_config_file);
                readfile = "";
        }
        else
index badf943..b98317e 100644 (file)
@@ -360,87 +360,90 @@ void bot_cmdhelp(string scmd)
                                break;
                }
 
-               LOG_INFO(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
-
-               LOG_INFO("Description: ");
+               string prelude = strcat(
+                   "Command: ", bot_cmd_string[i], "\n",
+                   "Parameter: <", stype, ">", "\n",
+                   "Description: "
+        );
                switch(i)
                {
                        case BOT_CMD_PAUSE:
-                               LOG_INFO("Stops the bot completely. Any command other than 'continue' will be ignored.");
+                               LOG_INFO(prelude, "Stops the bot completely. Any command other than 'continue' will be ignored.");
                                break;
                        case BOT_CMD_CONTINUE:
-                               LOG_INFO("Disable paused status");
+                               LOG_INFO(prelude, "Disable paused status");
                                break;
                        case BOT_CMD_WAIT:
-                               LOG_INFO("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
+                               LOG_INFO(prelude, "Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_WAIT_UNTIL:
-                               LOG_INFO("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
+                               LOG_INFO(prelude, "Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_BARRIER:
-                               LOG_INFO("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
+                               LOG_INFO(prelude, "Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_TURN:
-                               LOG_INFO("Look to the right or left N degrees. For turning to the left use positive numbers.");
+                               LOG_INFO(prelude, "Look to the right or left N degrees. For turning to the left use positive numbers.");
                                break;
                        case BOT_CMD_MOVETO:
-                               LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
+                               LOG_INFO(prelude, "Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
                                break;
                        case BOT_CMD_MOVETOTARGET:
-                               LOG_INFO("Walk to the specific target on the map");
+                               LOG_INFO(prelude, "Walk to the specific target on the map");
                                break;
                        case BOT_CMD_RESETGOAL:
-                               LOG_INFO("Resets the goal stack");
+                               LOG_INFO(prelude, "Resets the goal stack");
                                break;
                        case BOT_CMD_CC:
-                               LOG_INFO("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
+                               LOG_INFO(prelude, "Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
                                break;
                        case BOT_CMD_IF:
-                               LOG_INFO("Perform simple conditional execution.\n");
-                               LOG_INFO("Syntax: \n");
-                               LOG_INFO("        sv_cmd .. if \"condition\"\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if true>\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if true>\n");
-                               LOG_INFO("        sv_cmd .. else\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if false>\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if false>\n");
-                               LOG_INFO("        sv_cmd .. fi\n");
-                               LOG_INFO("Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n");
-                               LOG_INFO("            Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n");
-                               LOG_INFO("Fields: health, speed, flagcarrier\n");
-                               LOG_INFO("Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;");
+                               LOG_INFO(prelude, "Perform simple conditional execution.\n"
+                    "Syntax: \n"
+                    "        sv_cmd .. if \"condition\"\n"
+                    "        sv_cmd ..         <instruction if true>\n"
+                    "        sv_cmd ..         <instruction if true>\n"
+                    "        sv_cmd .. else\n"
+                    "        sv_cmd ..         <instruction if false>\n"
+                    "        sv_cmd ..         <instruction if false>\n"
+                    "        sv_cmd .. fi\n"
+                    "Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n"
+                    "            Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n"
+                    "Fields: health, speed, flagcarrier\n"
+                    "Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;"
+                               );
                                break;
                        case BOT_CMD_RESETAIM:
-                               LOG_INFO("Points the aim to the coordinates x,y 0,0");
+                               LOG_INFO(prelude, "Points the aim to the coordinates x,y 0,0");
                                break;
                        case BOT_CMD_AIM:
-                               LOG_INFO("Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n");
-                               LOG_INFO("There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n");
-                               LOG_INFO("Examples: aim \"90 0\"        // Turn 90 degrees inmediately (positive numbers move to the left/up)\n");
-                               LOG_INFO("          aim \"0 90 2\"      // Will gradually look to the sky in the next two seconds");
+                               LOG_INFO(prelude, "Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n"
+                                       "There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n"
+                                       "Examples: aim \"90 0\" // Turn 90 degrees inmediately (positive numbers move to the left/up)\n"
+                                       "          aim \"0 90 2\"       // Will gradually look to the sky in the next two seconds"
+                               );
                                break;
                        case BOT_CMD_AIMTARGET:
-                               LOG_INFO("Points the aim to given target");
+                               LOG_INFO(prelude, "Points the aim to given target");
                                break;
                        case BOT_CMD_PRESSKEY:
-                               LOG_INFO("Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use\n");
+                               LOG_INFO(prelude, "Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use\n");
                                LOG_INFO("Multiple keys can be pressed at time (with many presskey calls) and it will remain pressed until the command \"releasekey\" is called");
                                LOG_INFO("Note: The script will not return the control to the bot ai until all keys are released");
                                break;
                        case BOT_CMD_RELEASEKEY:
-                               LOG_INFO("Release previoulsy used keys. Use the parameter \"all\" to release all keys");
+                               LOG_INFO(prelude, "Release previoulsy used keys. Use the parameter \"all\" to release all keys");
                                break;
                        case BOT_CMD_SOUND:
-                               LOG_INFO("play sound file at bot location");
+                               LOG_INFO(prelude, "play sound file at bot location");
                                break;
                        case BOT_CMD_DEBUG_ASSERT_CANFIRE:
-                               LOG_INFO("verify the state of the weapon entity");
+                               LOG_INFO(prelude, "verify the state of the weapon entity");
                                break;
                        default:
-                               LOG_INFO("This command has no description yet.");
+                               LOG_INFO(prelude, "This command has no description yet.");
                                break;
                }
-               LOG_INFO("\n");
        }
 }
 
@@ -452,8 +455,10 @@ void bot_list_commands()
        if(!bot_cmds_initialized)
                bot_commands_init();
 
-       LOG_INFO("List of all available commands:\n");
-       LOG_INFO("  Command - Parameter Type\n");
+       LOG_INFO(
+           "List of all available commands:\n"
+           "  Command - Parameter Type\n"
+    );
 
        for(i=1;i<BOT_CMD_COUNTER;++i)
        {
@@ -472,7 +477,7 @@ void bot_list_commands()
                                ptype = "none";
                                break;
                }
-               LOG_INFO(strcat("  ",bot_cmd_string[i]," - <",ptype,"> \n"));
+               LOG_INFO("  ", bot_cmd_string[i]," - <", ptype, ">");
        }
 }
 
@@ -627,7 +632,7 @@ float bot_cmd_eval(entity this, string expr)
                        return ((this.flagcarried!=NULL));
        }
 
-       LOG_INFO(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n"));
+       LOG_INFO("ERROR: Unable to convert the expression '", expr, "' into a numeric value");
        return 0;
 }
 
@@ -1198,7 +1203,7 @@ float bot_execute_commands_once(entity this)
                if(bot_cmd.bot_cmd_type!=BOT_CMD_NULL)
                {
                        bot_command_executed(this, true);
-                       LOG_INFO( "WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
+                       LOG_INFO("WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
                }
                return 1;
        }
@@ -1296,12 +1301,12 @@ float bot_execute_commands_once(entity this)
                        status = bot_cmd_debug_assert_canfire(this);
                        break;
                default:
-                       LOG_INFO(strcat("ERROR: Invalid command on queue with id '",ftos(bot_cmd.bot_cmd_type),"'\n"));
+                       LOG_INFOF("ERROR: Invalid command on queue with id '%s'", ftos(bot_cmd.bot_cmd_type));
                        return 0;
        }
 
        if (status==CMD_STATUS_ERROR)
-               LOG_INFO(strcat("ERROR: The command '",bot_cmd_string[bot_cmd.bot_cmd_type],"' returned an error status\n"));
+               LOG_INFOF("ERROR: The command '%s' returned an error status", bot_cmd_string[bot_cmd.bot_cmd_type]);
 
        // Move execution pointer
        if(status==CMD_STATUS_EXECUTING)
index c8a958d..f08fc75 100644 (file)
@@ -518,7 +518,7 @@ void waypoint_load_or_remove_links_hardwired(bool removal_mode)
                        if(!found)
                        {
                                if(!removal_mode)
-                                       LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped\n"));
+                                       LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped\n");
                                continue;
                        }
                }
@@ -540,7 +540,7 @@ void waypoint_load_or_remove_links_hardwired(bool removal_mode)
                if(!found)
                {
                        if(!removal_mode)
-                               LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped\n"));
+                               LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped\n");
                        continue;
                }
 
index d90b372..55a5749 100644 (file)
@@ -44,7 +44,7 @@ void BanCommand_ban(float request, float argc, string command)
                        LOG_INFO("Incorrect parameters for ^2ban^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd ban address [bantime] [reason]\n");
+                       LOG_INFO("Usage:^3 sv_cmd ban address [bantime] [reason]\n");
                        LOG_INFO("  'address' is the IP address or range of the player to ban,\n");
                        LOG_INFO("  'bantime' is the amount of time that the ban is active (default if not provided),\n");
                        LOG_INFO("  and 'reason' is the string to label the ban with as reason for banning.\n");
@@ -67,7 +67,7 @@ void BanCommand_banlist(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd banlist\n");
+                       LOG_INFO("Usage:^3 sv_cmd banlist\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2ban, kickban, unban^7\n");
                        return;
@@ -111,7 +111,7 @@ void BanCommand_kickban(float request, float argc, string command)
                        LOG_INFO("Incorrect parameters for ^2kickban^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd kickban client [bantime] [masksize] [reason]\n");
+                       LOG_INFO("Usage:^3 sv_cmd kickban client [bantime] [masksize] [reason]\n");
                        LOG_INFO("  'client' is the entity number or name of the player to ban,\n");
                        LOG_INFO("  'bantime' is the amount of time that the ban is active (default if not provided),\n");
                        LOG_INFO("  'masksize' is the range of the IP address (1-thru-4, default if not provided),\n");
@@ -149,7 +149,7 @@ void BanCommand_mute(float request, float argc, string command)  // TODO: Add a
                        LOG_INFO("Incorrect parameters for ^2mute^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd mute client\n");
+                       LOG_INFO("Usage:^3 sv_cmd mute client\n");
                        LOG_INFO("  'client' is the entity number or name of the player to mute.\n");
                        LOG_INFO("See also: ^2unmute^7\n");
                        return;
@@ -195,7 +195,7 @@ void BanCommand_unban(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd unban banid\n");
+                       LOG_INFO("Usage:^3 sv_cmd unban banid\n");
                        LOG_INFO("  Where 'banid' is the ID of the ban of which to remove.\n");
                        LOG_INFO("See also: ^2ban, banlist, kickban^7\n");
                        return;
@@ -230,7 +230,7 @@ void BanCommand_unmute(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2mute^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd unmute client\n");
+                       LOG_INFO("Usage:^3 sv_cmd unmute client\n");
                        LOG_INFO("  'client' is the entity number or name of the player to unmute.\n");
                        LOG_INFO("See also: ^2mute^7\n");
                        return;
index d8bc3ac..46d1d2b 100644 (file)
@@ -179,7 +179,7 @@ float GetFilteredNumber(string input)
 void print_to(entity to, string input)
 {
        if (to) sprint(to, strcat(input, "\n"));
-       else LOG_INFO(input, "\n");
+       else print(input, "\n");
 }
 
 // ==========================================
@@ -437,7 +437,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                case "butcher":
                                {
                                        if (caller) { print_to(caller, "This command is not available to players"); return; }
-                                       if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string), "\n"); return; }
+                                       if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFOF("%s", M_ARGV(0, string)); return; }
 
                                        int tmp_remcount = 0;
 
index 49bee36..c123358 100644 (file)
@@ -156,7 +156,7 @@ void GameCommand_adminmsg(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2adminmsg^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd adminmsg clients \"message\" [infobartime]\n");
+                       LOG_INFO("Usage:^3 sv_cmd adminmsg clients \"message\" [infobartime]\n");
                        LOG_INFO("  'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
                        LOG_INFO("  If infobartime is provided, the message will be sent to infobar.\n");
                        LOG_INFO("  Otherwise, it will just be sent as a centerprint message.\n");
@@ -180,7 +180,7 @@ void GameCommand_allready(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd allready\n");
+                       LOG_INFO("Usage:^3 sv_cmd allready\n");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -208,7 +208,7 @@ void GameCommand_allspec(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd allspec [reason]\n");
+                       LOG_INFO("Usage:^3 sv_cmd allspec [reason]\n");
                        LOG_INFO("  Where 'reason' is an optional argument for explanation of allspec command.\n");
                        LOG_INFO("See also: ^2moveplayer, shuffleteams^7\n");
                        return;
@@ -240,7 +240,7 @@ void GameCommand_anticheat(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2anticheat^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd anticheat client\n");
+                       LOG_INFO("Usage:^3 sv_cmd anticheat client\n");
                        LOG_INFO("  'client' is the entity number or name of the player.\n");
                        return;
                }
@@ -312,7 +312,7 @@ void GameCommand_bbox(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd bbox\n");
+                       LOG_INFO("Usage:^3 sv_cmd bbox\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2gettaginfo, trace^7\n");
                        return;
@@ -415,7 +415,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                                bot_num++;
                                        });
                                        if(bot_num)
-                                               LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to all bots (", ftos(bot_num), ")\n"));
+                                               LOG_INFO("Command '", substring(command, argv_start_index(2), -1), "' sent to all bots (", ftos(bot_num), ")\n");
                                        return;
                                }
                                else
@@ -424,13 +424,13 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                        if (bot == NULL) bot = find_bot_by_name(argv(1));
                                        if (bot)
                                        {
-                                               LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
+                                               LOG_INFO("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n");
                                                bot_queuecommand(bot, substring(command, argv_start_index(2), -1));
                                                return;
                                        }
                                        else
                                        {
-                                               LOG_INFO(strcat("Error: Can't find bot with the name or id '", argv(1), "' - Did you mistype the command?\n"));  // don't return so that usage is shown
+                                               LOG_INFO("Error: Can't find bot with the name or id '", argv(1), "' - Did you mistype the command?\n");  // don't return so that usage is shown
                                        }
                                }
                        }
@@ -440,7 +440,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                        LOG_INFO("Incorrect parameters for ^2bot_cmd^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd bot_cmd client command [argument]\n");
+                       LOG_INFO("Usage:^3 sv_cmd bot_cmd client command [argument]\n");
                        LOG_INFO("  'client' can be either the name of the bot or a progressive number (not the entity number!)\n");
                        LOG_INFO("           can also be '*' or 'all' to allow sending the command to all the bots\n");
                        LOG_INFO("  For full list of commands, see bot_cmd help [command].\n");
@@ -469,7 +469,7 @@ void GameCommand_cointoss(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd cointoss [result1 result2]\n");
+                       LOG_INFO("Usage:^3 sv_cmd cointoss [result1 result2]\n");
                        LOG_INFO("  Where 'result1' and 'result2' are user created options.\n");
                        return;
                }
@@ -487,7 +487,7 @@ void GameCommand_database(float request, float argc)
                                if (argv(1) == "save")
                                {
                                        db_save(ServerProgsDB, argv(2));
-                                       LOG_INFO(strcat("Copied serverprogs database to '", argv(2), "' in the data directory.\n"));
+                                       LOG_INFO("Copied serverprogs database to '", argv(2), "' in the data directory.\n");
                                        return;
                                }
                                else if (argv(1) == "dump")
@@ -500,7 +500,7 @@ void GameCommand_database(float request, float argc)
                                {
                                        db_close(ServerProgsDB);
                                        ServerProgsDB = db_load(argv(2));
-                                       LOG_INFO(strcat("Loaded '", argv(2), "' as new serverprogs database.\n"));
+                                       LOG_INFO("Loaded '", argv(2), "' as new serverprogs database.\n");
                                        return;
                                }
                        }
@@ -510,7 +510,7 @@ void GameCommand_database(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2database^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd database action filename\n");
+                       LOG_INFO("Usage:^3 sv_cmd database action filename\n");
                        LOG_INFO("  Where 'action' is the command to complete,\n");
                        LOG_INFO("  and 'filename' is what it acts upon.\n");
                        LOG_INFO("  Full list of commands here: \"save, dump, load.\"\n");
@@ -548,7 +548,7 @@ void GameCommand_defer_clear(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2defer_clear^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd defer_clear client\n");
+                       LOG_INFO("Usage:^3 sv_cmd defer_clear client\n");
                        LOG_INFO("  'client' is the entity number or name of the player.\n");
                        LOG_INFO("See also: ^2defer_clear_all^7\n");
                        return;
@@ -570,14 +570,14 @@ void GameCommand_defer_clear_all(float request)
                                GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
                                ++n;
                        });
-                       if (n)   LOG_INFO(strcat("Successfully stuffed defer clear to all clients (", ftos(n), ")\n"));  // should a message be added if no players were found?
+                       if (n)   LOG_INFO("Successfully stuffed defer clear to all clients (", ftos(n), ")\n");  // should a message be added if no players were found?
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd defer_clear_all\n");
+                       LOG_INFO("Usage:^3 sv_cmd defer_clear_all\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2defer_clear^7\n");
                        return;
@@ -603,7 +603,7 @@ void GameCommand_delrec(float request, float argc)  // perhaps merge later with
                        LOG_INFO("Incorrect parameters for ^2delrec^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd delrec ranking [map]\n");
+                       LOG_INFO("Usage:^3 sv_cmd delrec ranking [map]\n");
                        LOG_INFO("  'ranking' is which ranking level to clear up to, \n");
                        LOG_INFO("  it will clear all records up to nth place.\n");
                        LOG_INFO("  if 'map' is not provided it will use current map.\n");
@@ -719,7 +719,7 @@ void GameCommand_effectindexdump(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd effectindexdump\n");
+                       LOG_INFO("Usage:^3 sv_cmd effectindexdump\n");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -739,7 +739,7 @@ void GameCommand_extendmatchtime(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd extendmatchtime\n");
+                       LOG_INFO("Usage:^3 sv_cmd extendmatchtime\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2reducematchtime^7\n");
                        return;
@@ -789,7 +789,7 @@ void GameCommand_gametype(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2gametype^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gametype mode\n");
+                       LOG_INFO("Usage:^3 sv_cmd gametype mode\n");
                        LOG_INFO("  Where 'mode' is the gametype mode to switch to.\n");
                        LOG_INFO("See also: ^2gotomap^7\n");
                        return;
@@ -826,13 +826,15 @@ void GameCommand_gettaginfo(float request, float argc)
                                if (i)
                                {
                                        v = gettaginfo(tmp_entity, i);
-                                       LOG_INFO("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
-                                       LOG_INFO(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
-                                       LOG_INFO(" vector = ", ftos(v.x), " ", ftos(v.y), " ", ftos(v.z), "\n");
-                                       LOG_INFO(" offset = ", ftos(gettaginfo_offset.x), " ", ftos(gettaginfo_offset.y), " ", ftos(gettaginfo_offset.z), "\n");
-                                       LOG_INFO(" forward = ", ftos(gettaginfo_forward.x), " ", ftos(gettaginfo_forward.y), " ", ftos(gettaginfo_forward.z), "\n");
-                                       LOG_INFO(" right = ", ftos(gettaginfo_right.x), " ", ftos(gettaginfo_right.y), " ", ftos(gettaginfo_right.z), "\n");
-                                       LOG_INFO(" up = ", ftos(gettaginfo_up.x), " ", ftos(gettaginfo_up.y), " ", ftos(gettaginfo_up.z), "\n");
+                                       LOG_INFOF(
+                                           "model %s frame %s tag %s index %s parent %s",
+                                           tmp_entity.model, ftos(tmp_entity.frame), gettaginfo_name, ftos(i), ftos(gettaginfo_parent)
+                                       );
+                                       LOG_INFOF(" vector = %s %s %s", ftos(v.x), ftos(v.y), ftos(v.z));
+                                       LOG_INFOF(" offset = %s %s %s", ftos(gettaginfo_offset.x), ftos(gettaginfo_offset.y), ftos(gettaginfo_offset.z));
+                                       LOG_INFOF(" forward = %s %s %s", ftos(gettaginfo_forward.x), ftos(gettaginfo_forward.y), ftos(gettaginfo_forward.z));
+                                       LOG_INFOF(" right = %s %s %s", ftos(gettaginfo_right.x), ftos(gettaginfo_right.y), ftos(gettaginfo_right.z));
+                                       LOG_INFOF(" up = %s %s %s", ftos(gettaginfo_up.x), ftos(gettaginfo_up.y), ftos(gettaginfo_up.z));
                                        if (argc >= 6)
                                        {
                                                v.y = -v.y;
@@ -853,7 +855,7 @@ void GameCommand_gettaginfo(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
+                       LOG_INFO("Usage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
                        LOG_INFO("See also: ^2bbox, trace^7\n");
                        return;
                }
@@ -912,7 +914,7 @@ void GameCommand_animbench(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
+                       LOG_INFO("Usage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
                        LOG_INFO("See also: ^2bbox, trace^7\n");
                        return;
                }
@@ -936,7 +938,7 @@ void GameCommand_gotomap(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2gotomap^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gotomap map\n");
+                       LOG_INFO("Usage:^3 sv_cmd gotomap map\n");
                        LOG_INFO("  Where 'map' is the *.bsp file to change to.\n");
                        LOG_INFO("See also: ^2gametype^7\n");
                        return;
@@ -965,7 +967,7 @@ void GameCommand_lockteams(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd lockteams\n");
+                       LOG_INFO("Usage:^3 sv_cmd lockteams\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2unlockteams^7\n");
                        return;
@@ -991,7 +993,7 @@ void GameCommand_make_mapinfo(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd make_mapinfo\n");
+                       LOG_INFO("Usage:^3 sv_cmd make_mapinfo\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2radarmap^7\n");
                        return;
@@ -1123,7 +1125,7 @@ void GameCommand_moveplayer(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2moveplayer^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd moveplayer clients destination\n");
+                       LOG_INFO("Usage:^3 sv_cmd moveplayer clients destination\n");
                        LOG_INFO("  'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
                        LOG_INFO("  'destination' is what to send the player to, be it team or spectating\n");
                        LOG_INFO("  Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
@@ -1157,7 +1159,7 @@ void GameCommand_nospectators(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd nospectators\n");
+                       LOG_INFO("Usage:^3 sv_cmd nospectators\n");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -1237,7 +1239,7 @@ void GameCommand_playerdemo(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2playerdemo^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)\n");
+                       LOG_INFO("Usage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)\n");
                        LOG_INFO("  Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"\n");
                        return;
                }
@@ -1258,7 +1260,7 @@ void GameCommand_printstats(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd printstats\n");
+                       LOG_INFO("Usage:^3 sv_cmd printstats\n");
                        LOG_INFO("  No arguments required.\n");
                        return;
                }
@@ -1278,7 +1280,7 @@ void GameCommand_radarmap(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2radarmap^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]\n");
+                       LOG_INFO("Usage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]\n");
                        LOG_INFO("  The quality factor Q is roughly proportional to the time taken.\n");
                        LOG_INFO("  trace supports no quality factor; its result should look like --block with infinite quality factor.\n");
                        LOG_INFO("See also: ^2make_mapinfo^7\n");
@@ -1300,7 +1302,7 @@ void GameCommand_reducematchtime(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd reducematchtime\n");
+                       LOG_INFO("Usage:^3 sv_cmd reducematchtime\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2extendmatchtime^7\n");
                        return;
@@ -1327,7 +1329,7 @@ void GameCommand_setbots(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2setbots^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd setbots botnumber\n");
+                       LOG_INFO("Usage:^3 sv_cmd setbots botnumber\n");
                        LOG_INFO("  Where 'botnumber' is the amount of bots to set bot_number cvar to.\n");
                        LOG_INFO("See also: ^2bot_cmd^7\n");
                        return;
@@ -1378,7 +1380,7 @@ void GameCommand_shuffleteams(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd shuffleteams\n");
+                       LOG_INFO("Usage:^3 sv_cmd shuffleteams\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2moveplayer, allspec^7\n");
                        return;
@@ -1405,7 +1407,7 @@ void GameCommand_stuffto(float request, float argc)
                                        if (accepted > 0)
                                        {
                                                stuffcmd(client, strcat("\n", argv(next_token), "\n"));
-                                               LOG_INFO(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1), ").\n"));
+                                               LOG_INFO("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1), ").");
                                        }
                                        else
                                        {
@@ -1420,7 +1422,7 @@ void GameCommand_stuffto(float request, float argc)
                                LOG_INFO("Incorrect parameters for ^2stuffto^7\n");
                        case CMD_REQUEST_USAGE:
                        {
-                               LOG_INFO("\nUsage:^3 sv_cmd stuffto client \"command\"\n");
+                               LOG_INFO("Usage:^3 sv_cmd stuffto client \"command\"\n");
                                LOG_INFO("  'client' is the entity number or name of the player,\n");
                                LOG_INFO("  and 'command' is the command to be sent to that player.\n");
                                return;
@@ -1596,7 +1598,7 @@ void GameCommand_trace(float request, float argc)
                        LOG_INFO("Incorrect parameters for ^2trace^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd trace command (startpos endpos)\n");
+                       LOG_INFO("Usage:^3 sv_cmd trace command (startpos endpos)\n");
                        LOG_INFO("  Full list of commands here: \"debug, debug2, walk, showline.\"\n");
                        LOG_INFO("See also: ^2bbox, gettaginfo^7\n");
                        return;
@@ -1625,7 +1627,7 @@ void GameCommand_unlockteams(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd unlockteams\n");
+                       LOG_INFO("Usage:^3 sv_cmd unlockteams\n");
                        LOG_INFO("  No arguments required.\n");
                        LOG_INFO("See also: ^2lockteams^7\n");
                        return;
@@ -1662,7 +1664,7 @@ void GameCommand_warp(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd warp [level]\n");
+                       LOG_INFO("Usage:^3 sv_cmd warp [level]\n");
                        LOG_INFO("  'level' is the level to change campaign mode to.\n");
                        LOG_INFO("  if 'level' is not provided it will change to the next level.\n");
                        return;
@@ -1780,20 +1782,22 @@ void GameCommand(string command)
        {
                if (argc == 1)
                {
-                       LOG_INFO("\nServer console commands:\n");
+                       LOG_INFO("Server console commands:");
                        GameCommand_macro_help();
 
-                       LOG_INFO("\nBanning commands:\n");
+                       LOG_INFO("\nBanning commands:");
                        BanCommand_macro_help();
 
-                       LOG_INFO("\nCommon networked commands:\n");
+                       LOG_INFO("\nCommon networked commands:");
                        CommonCommand_macro_help(NULL);
 
-                       LOG_INFO("\nGeneric commands shared by all programs:\n");
+                       LOG_INFO("\nGeneric commands shared by all programs:");
                        GenericCommand_macro_help();
 
-                       LOG_INFO("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
-                       LOG_INFO("For help about a specific command, type sv_cmd help COMMAND\n");
+                       LOG_INFO(
+                           "\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n"
+                "For help about a specific command, type sv_cmd help COMMAND"
+            );
 
                        return;
                }
index 6211362..dfda728 100644 (file)
@@ -100,11 +100,11 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
        tokenize_console(autocvar_g_ban_sync_uri);
        uri = argv(id);
 
-       LOG_INFO("Received ban list from ", uri, ": ");
+       string prelude = strcat("Received ban list from ", uri, ": ");
 
        if(OnlineBanList_RequestWaiting[id] == 0)
        {
-               LOG_INFO("rejected (unexpected)\n");
+               LOG_INFO(prelude, "rejected (unexpected)\n");
                return;
        }
 
@@ -112,14 +112,14 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if(time > OnlineBanList_Timeout)
        {
-               LOG_INFO("rejected (too late)\n");
+               LOG_INFO(prelude, "rejected (too late)\n");
                return;
        }
 
        syncinterval = autocvar_g_ban_sync_interval;
        if(syncinterval == 0)
        {
-               LOG_INFO("rejected (syncing disabled)\n");
+               LOG_INFO(prelude, "rejected (syncing disabled)\n");
                return;
        }
        if(syncinterval > 0)
@@ -127,19 +127,19 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if(status != 0)
        {
-               LOG_INFO("error: status is ", ftos(status), "\n");
+               LOG_INFO(prelude, "error: status is ", ftos(status), "\n");
                return;
        }
 
        if(substring(data, 0, 1) == "<")
        {
-               LOG_INFO("error: received HTML instead of a ban list\n");
+               LOG_INFO(prelude, "error: received HTML instead of a ban list\n");
                return;
        }
 
        if(strstrofs(data, "\r", 0) != -1)
        {
-               LOG_INFO("error: received carriage returns\n");
+               LOG_INFO(prelude, "error: received carriage returns\n");
                return;
        }
 
@@ -150,11 +150,11 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if((n % 4) != 0)
        {
-               LOG_INFO("error: received invalid item count: ", ftos(n), "\n");
+               LOG_INFO(prelude, "error: received invalid item count: ", ftos(n), "\n");
                return;
        }
 
-       LOG_INFO("OK, ", ftos(n / 4), " items\n");
+       LOG_INFO(prelude, "OK, ", ftos(n / 4), " items\n");
 
        for(i = 0; i < n; i += 4)
        {
@@ -191,8 +191,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                        // the ban will be prolonged on the next sync
                        // or expire 5 seconds after the next timeout
                Ban_Insert(ip, timeleft, strcat("ban synced from ", serverip, " at ", uri), 0);
-               LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ");
-               LOG_INFO(reason, "\n");
+               LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ", reason);
 
 LABEL(skip)
        }
index 254e799..b5156f4 100644 (file)
@@ -83,10 +83,11 @@ void relocate_spawnpoint(entity this)
         this.maxs = PL_MAX_CONST;
         if (!move_out_of_solid(this))
             objerror(this, "could not get out of solid at all!");
-        LOG_INFO("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));
-        LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
-        LOG_INFO(" ", ftos(this.origin.y - o.y));
-        LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+        LOG_INFOF(
+            "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
+            vtos(o - '0 0 1'),
+            vtos(this.origin - o)
+        );
         if (autocvar_g_spawnpoints_auto_move_out_of_solid)
         {
             if (!spawnpoint_nag)
index 74dce96..1a5c8e5 100644 (file)
@@ -184,7 +184,6 @@ void StartFrame()
        if(time > client_cefc_accumulatortime + 1)
        {
                float t = client_cefc_accumulator / (time - client_cefc_accumulatortime);
-               LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
                int c_seeing = 0;
                int c_seen = 0;
                FOREACH_CLIENT(true, {
@@ -193,9 +192,11 @@ void StartFrame()
                        if(IS_PLAYER(it))
                                ++c_seen;
                });
-               LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
-               LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
-
+               LOG_INFO(
+                   "CEFC time: ", ftos(t * 1000), "ms; ",
+            "CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ",
+            "CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0')
+        );
                client_cefc_accumulatortime = time;
                client_cefc_accumulator = 0;
        }