Skip to content

Commit

Permalink
Cleanup|Client: Log entries, levels, and domains (continued)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 9, 2014
1 parent e8af1a9 commit 2ffec24
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 52 deletions.
5 changes: 0 additions & 5 deletions doomsday/client/src/audio/s_logic.cpp
Expand Up @@ -228,11 +228,6 @@ void Sfx_PurgeLogical(void)
for(it = logicHash[i].first; it; it = next)
{
next = it->next;
/*#ifdef _DEBUG
Con_Printf("LS:%i orig=%i(%p) %s\n",
it->id, it->origin? it->origin->thinker.id : 0,
it->origin, it->isRepeating? "[repeat]" : "");
#endif */
if(!it->isRepeating && it->endTime < nowTime)
{
// This has stopped.
Expand Down
5 changes: 1 addition & 4 deletions doomsday/client/src/busymode.cpp
Expand Up @@ -169,10 +169,7 @@ static void endTask(BusyTask* task)
DENG_ASSERT(task);
DENG_ASSERT_IN_MAIN_THREAD();

if(verbose)
{
Con_Message("Con_Busy: Was busy for %.2lf seconds.", busyTime);
}
LOG_VERBOSE("Busy mode lasted %.2f seconds") << busyTime;

if(busyTaskEndedWithError)
{
Expand Down
7 changes: 0 additions & 7 deletions doomsday/client/src/client/cl_mobj.cpp
Expand Up @@ -292,13 +292,6 @@ void Cl_UpdateRealPlayerMobj(mobj_t *localMobj, mobj_t *remoteClientMobj,
}

localMobj->height = remoteClientMobj->height;
/*#ifdef _DEBUG
if(localMobj->floorClip != remoteClientMobj->floorClip)
{
Con_Message("Cl_UpdateRealPlayerMobj: Floorclip=%f", remoteClientMobj->floorClip);
}
#endif
localMobj->floorClip = remoteClientMobj->floorClip;*/
localMobj->selector &= ~DDMOBJ_SELECTOR_MASK;
localMobj->selector |= remoteClientMobj->selector & DDMOBJ_SELECTOR_MASK;
localMobj->visAngle = remoteClientMobj->angle >> 16;
Expand Down
15 changes: 9 additions & 6 deletions doomsday/client/src/dd_loop.cpp
Expand Up @@ -206,8 +206,12 @@ static void baseTicker(timespan_t time)
coord_t actualMom[2] = { mo->origin[0] - prevPos[0], mo->origin[1] - prevPos[1] };
coord_t actualSpeed = V2d_Length(actualMom);

Con_Message("%i,%f,%f,%f,%f", SECONDS_TO_TICKS(sysTime + time),
ddPlayers[0].shared.forwardMove, speed, actualSpeed, speed - prevSpeed);
LOG_NOTE("%i,%f,%f,%f,%f")
<< SECONDS_TO_TICKS(sysTime + time)
<< ddPlayers[0].shared.forwardMove
<< speed
<< actualSpeed
<< speed - prevSpeed;

V3d_Copy(prevPos, mo->origin);
prevSpeed = speed;
Expand Down Expand Up @@ -307,10 +311,9 @@ static void timeDeltaStatistics(int deltaMs)
}
average /= NUM_FRAMETIME_DELTAS;
variance /= NUM_FRAMETIME_DELTAS;
Con_Message("Time deltas [%i frames]: min=%-6i max=%-6i avg=%-11.7f late=%5.1f%% var=%12.10f",
NUM_FRAMETIME_DELTAS, minDelta, maxDelta, average,
lateCount/(float)NUM_FRAMETIME_DELTAS*100,
variance);
LOGDEV_MSG("Time deltas [%i frames]: min=%-6i max=%-6i avg=%-11.7f late=%5.1f%% var=%12.10f")
<< NUM_FRAMETIME_DELTAS << minDelta << maxDelta << average
<< lateCount/(float)NUM_FRAMETIME_DELTAS*100 << variance;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/dd_main.cpp
Expand Up @@ -732,7 +732,7 @@ static void loadResource(ResourceManifest &manifest)
// Print the 'CRC' number of IWADs, so they can be identified.
if(Wad *wad = dynamic_cast<Wad*>(file))
{
Con_Message(" IWAD identification: %08x", wad->calculateCRC());
LOG_RES_MSG("IWAD identification: %08x") << wad->calculateCRC();
}
}
}
Expand Down
61 changes: 32 additions & 29 deletions doomsday/client/src/dd_wad.cpp
Expand Up @@ -35,21 +35,16 @@

using namespace de;

#if _DEBUG
# define W_Error Con_Error
#else
# define W_Error Con_Message
#endif

size_t W_LumpLength(lumpnum_t lumpNum)
{
try
{
return App_FileSystem().nameIndex().lump(lumpNum).info().size;
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_LumpLength: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_LumpLength");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return 0;
}
Expand All @@ -62,9 +57,10 @@ AutoStr* W_LumpName(lumpnum_t lumpNum)
QByteArray nameUtf8 = name.toUtf8();
return AutoStr_FromTextStd(nameUtf8.constData());
}
catch(FS1::NotFoundError const&)
catch(FS1::NotFoundError const &er)
{
W_Error("W_LumpName: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_LumpName");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return AutoStr_NewStd();
}
Expand All @@ -75,24 +71,26 @@ uint W_LumpLastModified(lumpnum_t lumpNum)
{
return App_FileSystem().nameIndex().lump(lumpNum).info().lastModified;
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_LumpLastModified: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_LumpLastModified");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return 0;
}

AutoStr* W_LumpSourceFile(lumpnum_t lumpNum)
AutoStr *W_LumpSourceFile(lumpnum_t lumpNum)
{
try
{
de::File1 const& lump = App_FileSystem().nameIndex().lump(lumpNum);
QByteArray path = lump.container().composePath().toUtf8();
return AutoStr_FromText(path.constData());
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_LumpSourceFile: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_LumpSourceFile");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return AutoStr_NewStd();
}
Expand All @@ -104,14 +102,15 @@ boolean W_LumpIsCustom(lumpnum_t lumpNum)
de::File1 const& lump = App_FileSystem().nameIndex().lump(lumpNum);
return lump.container().hasCustom();
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_LumpIsCustom: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_LumpIsCustom");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return false;
}

lumpnum_t W_CheckLumpNumForName(char const* name)
lumpnum_t W_CheckLumpNumForName(char const *name)
{
lumpnum_t lumpNum;
if(!name || !name[0])
Expand All @@ -123,12 +122,12 @@ lumpnum_t W_CheckLumpNumForName(char const* name)
return lumpNum;
}

lumpnum_t W_GetLumpNumForName(char const* name)
lumpnum_t W_GetLumpNumForName(char const *name)
{
lumpnum_t lumpNum = W_CheckLumpNumForName(name);
if(lumpNum < 0)
{
W_Error("W_GetLumpNumForName: Lump \"%s\" not found.", name);
LOG_RES_ERROR("Lump \"%s\" not found") << name;
}
return lumpNum;
}
Expand All @@ -140,9 +139,10 @@ size_t W_ReadLump(lumpnum_t lumpNum, uint8_t* buffer)
de::File1& lump = App_FileSystem().nameIndex().lump(lumpNum);
return lump.read(buffer, 0, lump.size());
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_ReadLump: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_ReadLump");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return 0;
}
Expand All @@ -154,22 +154,24 @@ size_t W_ReadLumpSection(lumpnum_t lumpNum, uint8_t* buffer, size_t startOffset,
de::File1& lump = App_FileSystem().nameIndex().lump(lumpNum);
return lump.read(buffer, startOffset, length);
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_ReadLumpSection: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_ReadLumpSection");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return 0;
}

uint8_t const* W_CacheLump(lumpnum_t lumpNum)
uint8_t const *W_CacheLump(lumpnum_t lumpNum)
{
try
{
return App_FileSystem().nameIndex().lump(lumpNum).cache();
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_CacheLump: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_CacheLump");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return NULL;
}
Expand All @@ -180,9 +182,10 @@ void W_UnlockLump(lumpnum_t lumpNum)
{
App_FileSystem().nameIndex().lump(lumpNum).unlock();
}
catch(LumpIndex::NotFoundError const&)
catch(LumpIndex::NotFoundError const &er)
{
W_Error("W_UnlockLump: Invalid lumpnum %i.", lumpNum);
LOG_AS("W_UnlockLump");
LOGDEV_RES_ERROR("%s") << er.asText();
}
return;
}
Expand Down

0 comments on commit 2ffec24

Please sign in to comment.