Skip to content

Commit b0bb7ab

Browse files
committed
Tweak log messages again
Sadly LoggingSystem_Log doesn't work in linux for some reason
1 parent 11739e3 commit b0bb7ab

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/multiaddonmanager.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void Message(const char *msg, ...)
4242
char buf[1024] = {};
4343
V_vsnprintf(buf, sizeof(buf) - 1, msg, args);
4444

45-
LoggingSystem_Log(20, LS_MESSAGE, Color(0, 255, 200), "[MultiAddonManager] %s", buf);
45+
ConColorMsg(Color(0, 255, 200), "[MultiAddonManager] %s", buf);
4646

4747
va_end(args);
4848
}
@@ -55,7 +55,7 @@ void Panic(const char *msg, ...)
5555
char buf[1024] = {};
5656
V_vsnprintf(buf, sizeof(buf) - 1, msg, args);
5757

58-
LoggingSystem_Log(20, LS_WARNING, Color(255, 255, 0), "[MultiAddonManager] %s", buf);
58+
Warning("[MultiAddonManager] %s", buf);
5959

6060
va_end(args);
6161
}
@@ -214,13 +214,13 @@ bool MultiAddonManager::MountAddon(const char *pszAddon, bool bAddToTail = false
214214

215215
if (!g_pFullFileSystem->FileExists(path))
216216
{
217-
Panic(__FUNCTION__": Addon %s not found at %s\n", pszAddon, path);
217+
Panic("%s: Addon %s not found at %s\n", __func__, pszAddon, path);
218218
return false;
219219
}
220220

221221
if (g_vecMountedAddons.Find(pszAddon) != -1)
222222
{
223-
Panic(__FUNCTION__": Addon %s is already mounted\n", pszAddon);
223+
Panic("%s: Addon %s is already mounted\n", __func__, pszAddon);
224224
return false;
225225
}
226226

@@ -254,15 +254,15 @@ void MultiAddonManager::DownloadAddon(const char *pszAddon, bool bForce = false)
254254
{
255255
if (!g_SteamAPI.SteamUGC())
256256
{
257-
Panic(__FUNCTION__": Cannot download addons as the Steam API is not initialized\n");
257+
Panic("%s: Cannot download addons as the Steam API is not initialized\n", __func__);
258258
return;
259259
}
260260

261261
PublishedFileId_t addon = V_StringToUint64(pszAddon, 0);
262262

263263
if (addon == 0)
264264
{
265-
Panic(__FUNCTION__": Invalid addon %s\n", pszAddon);
265+
Panic("%s: Invalid addon %s\n", __func__, pszAddon);
266266
return;
267267
}
268268

@@ -276,7 +276,7 @@ void MultiAddonManager::DownloadAddon(const char *pszAddon, bool bForce = false)
276276

277277
if (!g_SteamAPI.SteamUGC()->DownloadItem(addon, true))
278278
{
279-
Panic(__FUNCTION__": Addon download for %lli failed to start, addon ID is invalid or server is not logged on Steam\n", addon);
279+
Panic("%s: Addon download for %lli failed to start, addon ID is invalid or server is not logged on Steam\n", __func__, addon);
280280
return;
281281
}
282282

@@ -316,7 +316,7 @@ void MultiAddonManager::OnAddonDownloaded(DownloadItemResult_t *pResult)
316316
{
317317
if (pResult->m_eResult != k_EResultOK)
318318
{
319-
Panic(__FUNCTION__": Addon %lli download failed with status %i\n", pResult->m_nPublishedFileId, pResult->m_eResult);
319+
Panic("%s: Addon %lli download failed with status %i\n", __func__, pResult->m_nPublishedFileId, pResult->m_eResult);
320320
return;
321321
}
322322

@@ -459,7 +459,7 @@ ClientJoinInfo_t *GetPendingClient(INetChannel *pNetChan)
459459

460460
void MultiAddonManager::Hook_StartupServer(const GameSessionConfiguration_t &config, ISource2WorldSession *, const char *)
461461
{
462-
Message(__FUNCTION__ ": %s\n", g_pEngineServer->GetServerGlobals()->mapname);
462+
Message("%s: %s\n", __func__, g_pEngineServer->GetServerGlobals()->mapname);
463463

464464
g_pNetworkGameServer = g_pNetworkServerService->GetIGameServer();
465465
g_ClientsPendingAddon.RemoveAll();
@@ -486,7 +486,7 @@ void FASTCALL Hook_SendNetMessage(INetChannel *pNetChan, INetworkSerializable *p
486486

487487
if (pPendingClient)
488488
{
489-
Message(__FUNCTION__": Sending addon %s to client %lli\n", g_vecExtraAddons[pPendingClient->addon].c_str(), pPendingClient->steamid);
489+
Message("%s: Sending addon %s to client %lli\n", __func__, g_vecExtraAddons[pPendingClient->addon].c_str(), pPendingClient->steamid);
490490

491491
CNETMsg_SignonState *pMsg = (CNETMsg_SignonState *)pData;
492492
pMsg->set_addons(g_vecExtraAddons[pPendingClient->addon]);
@@ -506,7 +506,7 @@ void* FASTCALL Hook_HostStateRequest(void *a1, void **pRequest)
506506
// This offset hasn't changed in 6 years so it should be safe
507507
CUtlString *sAddonString = (CUtlString *)(pRequest + 11);
508508

509-
Message(__FUNCTION__": appending \"%s\" to addon string \"%s\"\n", g_sExtraAddons.c_str(), sAddonString->Get());
509+
Message("%s: appending \"%s\" to addon string \"%s\"\n", __func__, g_sExtraAddons.c_str(), sAddonString->Get());
510510

511511
// addons are simply comma-delimited, can have any number of them
512512
if (!sAddonString->IsEmpty())

0 commit comments

Comments
 (0)