Skip to content

Commit

Permalink
Cleanup: Log entries, levels, and domains (continued)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 13, 2014
1 parent aca7c3b commit 5e9ac8a
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 64 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/src/dd_main.cpp
Expand Up @@ -1985,7 +1985,7 @@ dd_bool DD_Init(void)
//Con_Execute(CMDS_DDAY, "conopen", true, false);
if(!CommandLine_Exists("-noautoselect"))
{
LOG_INFO("Automatic game selection failed");
LOG_WARNING("Game could not be selected automatically");
}
/// @todo Whether or not to list the games depends on whether the app
/// has a graphical interface. The graphical client will display the
Expand Down
3 changes: 0 additions & 3 deletions doomsday/client/src/resource/texturemanifest.cpp
Expand Up @@ -68,9 +68,6 @@ Texture *TextureManifest::derive()
}
else
{
/*#ifdef DENG_DEBUG
LOG_INFO("\"%s\" already has an existing texture, reconfiguring.") << composeUri();
#endif*/
Texture *tex = &texture();

/// @todo Materials and Surfaces should be notified of this!
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/world/bsp/convexsubspace.cpp
Expand Up @@ -168,7 +168,7 @@ struct Continuity
#ifdef DENG_DEBUG
void debugPrint() const
{
LOG_INFO("Continuity %p (sector:%i, coverage:%f, discord:%i)")
LOGDEV_MAP_MSG("Continuity %p (sector:%i, coverage:%f, discord:%i)")
<< this
<< (sector? sector->indexInArchive() : -1)
<< coverage
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/world/bsp/hplane.cpp
Expand Up @@ -87,7 +87,7 @@ LineSegmentSide *HPlane::Intercept::afterLineSegment() const
#ifdef DENG_DEBUG
void HPlane::Intercept::debugPrint() const
{
LOG_INFO("Vertex #%i %s beforeSector: #%d afterSector: #%d %s")
LOGDEV_MAP_MSG("Vertex #%i %s beforeSector: #%d afterSector: #%d %s")
<< vertex().indexInMap()
<< vertex().origin().asText()
<< (_before && _before->hasSector()? _before->sector().indexInArchive() : -1)
Expand Down
46 changes: 23 additions & 23 deletions doomsday/client/src/world/map.cpp
Expand Up @@ -251,7 +251,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
{
return &linkStore[linkStoreCursor++];
}
LOG_WARNING("Exhausted generator link storage");
LOG_MAP_WARNING("Exhausted generator link storage");
return 0;
}
};
Expand Down Expand Up @@ -567,7 +567,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)

if(!leaf.hasParent())
{
LOG_WARNING("BSP leaf %p has degenerate geometry (%d half-edges).")
LOG_MAP_WARNING("BSP leaf %p has degenerate geometry (%d half-edges).")
<< &leaf << (leaf.hasPoly()? leaf.poly().hedgeCount() : 0);

// Attribute this leaf directly to the map.
Expand All @@ -590,7 +590,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)

if(discontinuities)
{
LOG_WARNING("Face geometry for BSP leaf [%p] at %s in sector %i "
LOG_MAP_WARNING("Face geometry for BSP leaf [%p] at %s in sector %i "
"is not contiguous (%i gaps/overlaps).\n%s")
<< &leaf << leaf.poly().center().asText()
<< (leaf.hasParent()? leaf.parent().as<Sector>().indexInArchive() : -1)
Expand Down Expand Up @@ -629,7 +629,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
// It begins...
Time begunAt;

LOG_TRACE("Building BSP for \"%s\" with split cost factor %d...")
LOGDEV_MAP_XVERBOSE("Building BSP for \"%s\" with split cost factor %d...")
<< uri << bspSplitFactor;

// First we'll scan for so-called "one-way window" constructs and mark
Expand Down Expand Up @@ -659,8 +659,8 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
// Build a BSP!
BspTreeNode *rootNode = partitioner.buildBsp(linesToBuildBspFor, mesh);

LOG_INFO("BSP built: %d Nodes, %d Leafs, %d Segments and %d Vertexes."
"\nTree balance is %d:%d.")
LOG_MAP_VERBOSE("BSP built: %d Nodes, %d Leafs, %d Segments and %d Vertexes. "
"Tree balance is %d:%d.")
<< partitioner.numNodes() << partitioner.numLeafs()
<< partitioner.numSegments() << partitioner.numVertexes()
<< (rootNode->isLeaf()? 0 : rootNode->right().height())
Expand Down Expand Up @@ -728,11 +728,11 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
}
catch(Error const &er)
{
LOG_WARNING("%s.") << er.asText();
LOG_MAP_WARNING("%s.") << er.asText();
}

// How much time did we spend?
LOG_INFO(String("BSP built in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOGDEV_MAP_VERBOSE("BSP built in %.2f seconds") << begunAt.since();

return bspRoot != 0;
}
Expand Down Expand Up @@ -761,7 +761,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
new LineBlockmap(AABoxd(bounds.minX - margin, bounds.minY - margin,
bounds.maxX + margin, bounds.maxY + margin)));

LOG_INFO("Line blockmap dimensions:")
LOG_MAP_VERBOSE("Line blockmap dimensions:")
<< lineBlockmap->dimensions().asText();

// Populate the blockmap.
Expand All @@ -781,7 +781,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
new Blockmap(AABoxd(bounds.minX - margin, bounds.minY - margin,
bounds.maxX + margin, bounds.maxY + margin)));

LOG_INFO("Mobj blockmap dimensions:")
LOG_MAP_VERBOSE("Mobj blockmap dimensions:")
<< mobjBlockmap->dimensions().asText();
}

Expand Down Expand Up @@ -902,7 +902,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
new Blockmap(AABoxd(bounds.minX - margin, bounds.minY - margin,
bounds.maxX + margin, bounds.maxY + margin)));

LOG_INFO("Polyobj blockmap dimensions:")
LOG_MAP_VERBOSE("Polyobj blockmap dimensions:")
<< polyobjBlockmap->dimensions().asText();
}

Expand All @@ -919,7 +919,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
new Blockmap(AABoxd(bounds.minX - margin, bounds.minY - margin,
bounds.maxX + margin, bounds.maxY + margin)));

LOG_INFO("BSP leaf blockmap dimensions:")
LOG_MAP_VERBOSE("BSP leaf blockmap dimensions:")
<< bspLeafBlockmap->dimensions().asText();

// Populate the blockmap.
Expand Down Expand Up @@ -1308,7 +1308,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
{
// Warning message disabled as these are occuring so thick and fast
// that logging is pointless (and negatively affecting performance).
//LOG_DEBUG("Attempted repeat link of generator %p to list %u.")
//LOGDEV_MAP_VERBOSE("Attempted repeat link of generator %p to list %u.")
// << gen << listIndex;
found = true; // No, no...
}
Expand Down Expand Up @@ -1496,7 +1496,7 @@ void Map::initGenerators()
Time begunAt;
P_SpawnTypeParticleGens(*this);
P_SpawnMapParticleGens(*this);
LOG_MAP_VERBOSE("Completed in %.2f seconds") << begunAt.since();
LOGDEV_MAP_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

void Map::clearClMobjs()
Expand Down Expand Up @@ -2970,7 +2970,7 @@ D_CMD(InspectMap)

if(!App_WorldSystem().hasMap())
{
LOG_WARNING("No map is currently loaded.");
LOG_MAP_WARNING("No map is currently loaded");
return false;
}

Expand All @@ -2979,7 +2979,7 @@ D_CMD(InspectMap)

#define TABBED(count, label) String(_E(Ta) " %1 " _E(Tb) "%2\n").arg(count).arg(label)

LOG_MSG(_E(b) "Current map elements:");
LOG_MAP_MSG(_E(b) "Current map elements:");
String str;
QTextStream os(&str);
os << TABBED(map.vertexCount(), "Vertexes");
Expand All @@ -2989,7 +2989,7 @@ D_CMD(InspectMap)
os << TABBED(map.bspNodeCount(), "BSP Nodes");
os << TABBED(map.bspLeafCount(), "BSP Leafs");

LOG_INFO("%s") << str.rightStrip();
LOG_MAP_MSG("%s") << str.rightStrip();

return true;

Expand Down Expand Up @@ -3242,15 +3242,15 @@ void buildVertexLineOwnerRings(Map::Vertexes const &vertexes, Map::Lines &editab
last->_angle = last->angle() - firstAngle;

/*#ifdef DENG2_DEBUG
LOG_VERBOSE("Vertex #%i: line owners #%i")
LOG_MAP_VERBOSE("Vertex #%i: line owners #%i")
<< editmap.vertexes.indexOf(v) << v->lineOwnerCount();
LineOwner const *base = v->firstLineOwner();
LineOwner const *cur = base;
uint idx = 0;
do
{
LOG_VERBOSE(" %i: p= #%05i this= #%05i n= #%05i, dANG= %-3.f")
LOG_MAP_VERBOSE(" %i: p= #%05i this= #%05i n= #%05i, dANG= %-3.f")
<< idx << cur->prev().line().indexInMap() << cur->line().indexInMap()
<< cur->next().line().indexInMap() << BANG2DEG(cur->angle());
Expand Down Expand Up @@ -3405,7 +3405,7 @@ void pruneVertexes(Mesh &mesh, Map::Lines const &lines)
line->updateAABox();
}

LOG_INFO("Pruned %d vertexes (%d equivalents, %d unused).")
LOGDEV_MAP_NOTE("Pruned %d vertexes (%d equivalents, %d unused).")
<< prunedCount << (prunedCount - numUnused) << numUnused;
}
}
Expand All @@ -3417,8 +3417,8 @@ bool Map::endEditing()
d->editingEnabled = false;

LOG_AS("Map");
LOG_VERBOSE("Editing ended.");
LOG_DEBUG("New elements: %d Vertexes, %d Lines, %d Polyobjs and %d Sectors.")
LOG_MAP_VERBOSE("Editing ended.");
LOGDEV_MAP_VERBOSE("New elements: %d Vertexes, %d Lines, %d Polyobjs and %d Sectors.")
<< d->mesh.vertexCount() << d->editable.lines.count()
<< d->editable.polyobjs.count() << d->editable.sectors.count();

Expand Down Expand Up @@ -3488,7 +3488,7 @@ bool Map::endEditing()

// Determine the map bounds.
d->updateBounds();
LOG_INFO("Geometry bounds:") << Rectangled(d->bounds.min, d->bounds.max).asText();
LOG_MAP_VERBOSE("Geometry bounds:") << Rectangled(d->bounds.min, d->bounds.max).asText();

// Build a line blockmap.
d->initLineBlockmap();
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/world/worldsystem.cpp
Expand Up @@ -166,7 +166,7 @@ class MapConversionReporter
if(numToLog < unclosedSectorCount())
str += String("\n(%1 more like this)").arg(unclosedSectorCount() - numToLog);

LOG_WARNING("%s") << str;
LOG_MAP_WARNING("%s") << str;
}

if(int numToLog = maxWarnings(oneWayWindowCount()))
Expand All @@ -184,7 +184,7 @@ class MapConversionReporter
if(numToLog < oneWayWindowCount())
str += String("\n(%1 more like this)").arg(oneWayWindowCount() - numToLog);

LOG_VERBOSE("%s") << str;
LOG_MAP_VERBOSE("%s") << str;
}
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/g_game.c
Expand Up @@ -3948,7 +3948,7 @@ D_CMD(CycleTextureGamma)

D_CMD(ListMaps)
{
App_Log(DE2_LOG_MSG, "Available maps:");
App_Log(DE2_LOG_MESSAGE, "Available maps:");
G_PrintMapList();
return true;
}
Expand Down
1 change: 0 additions & 1 deletion doomsday/plugins/common/src/p_map.cpp
Expand Up @@ -1144,7 +1144,6 @@ dd_bool P_CheckPositionXYZ(mobj_t *thing, coord_t x, coord_t y, coord_t z)
(thing->onMobj->flags & MF_SOLID) != 0,
thing, thing->thinker.id);
}
#endif
}

#if __JHEXEN__
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/common/src/p_mapsetup.cpp
Expand Up @@ -579,8 +579,8 @@ static void spawnMapObjects()
}

App_Log(DE2_DEV_MAP_XVERBOSE, "Spawning mobj at (%g, %g, %g) angle:%i ednum:%i flags:%x",
spot->pos[VX], spot->pos[VY], spot->pos[VZ], spot->angle,
spot->doomedNum, spot->flags);
spot->origin[VX], spot->origin[VY], spot->origin[VZ], spot->angle,
spot->doomEdNum, spot->flags);

if(mobj_t *mo = P_SpawnMobj(type, spot->origin, spot->angle, spot->flags))
{
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/common/src/p_xgfile.c
Expand Up @@ -34,6 +34,7 @@

#include <stdio.h>
#include <string.h>
#include <de/memory.h>

#if __JDOOM__
# include "jdoom.h"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/pause.c
Expand Up @@ -153,7 +153,7 @@ void Pause_SetForcedPeriod(int tics)
{
if(tics <= 0) return;

App_Log(DE2_LOG_MSG, "Forced pause for %i tics", tics);
App_Log(DE2_LOG_MESSAGE, "Forced pause for %i tics", tics);

forcedPeriodTicsRemaining = tics;
beginPause(PAUSEF_FORCED_PERIOD);
Expand Down
10 changes: 5 additions & 5 deletions doomsday/plugins/dehread/src/dehreader.cpp
Expand Up @@ -215,12 +215,12 @@ class DehReader
void logPatchInfo()
{
// Log reader settings and patch version information.
LOG_INFO("Patch version: %i Doom version: %i\nNoText: %b")
LOG_RES_MSG("DeHackEd patch version: %i, Doom version: %i\nNoText: %b")
<< patchVersion << doomVersion << bool(flags & NoText);

if(patchVersion != 6)
{
LOG_WARNING("Unknown patch version. Unexpected results may occur.") << patchVersion;
LOG_WARNING("Unknown DeHackEd patch version, unexpected results may occur") << patchVersion;
}
}

Expand Down Expand Up @@ -638,7 +638,7 @@ class DehReader
if(!file.open(QFile::ReadOnly | QFile::Text))
{
LOG_AS("parseInclude");
LOG_WARNING("Failed opening \"%s\" for read, aborting...") << filePath;
LOG_RES_WARNING("Failed opening \"%s\" for read, aborting...") << filePath;
}
else
{
Expand All @@ -647,7 +647,7 @@ class DehReader
deh.append(QChar(0));
file.close();

LOG_INFO("Including \"%s\"...") << F_PrettyPath(filePath.toUtf8().constData());
LOG_RES_VERBOSE("Including \"%s\"...") << F_PrettyPath(filePath.toUtf8().constData());

try
{
Expand All @@ -662,7 +662,7 @@ class DehReader
else
{
LOG_AS("parseInclude");
LOG_WARNING("Include directive missing filename, ignoring.");
LOG_RES_WARNING("DeHackEd Include directive missing filename");
}
}
}
Expand Down

0 comments on commit 5e9ac8a

Please sign in to comment.