Skip to content

Commit

Permalink
Cleanup|Client|libgui: Log levels and domains
Browse files Browse the repository at this point in the history
Todo: Much more of this to come…
  • Loading branch information
skyjake committed Jan 8, 2014
1 parent fe3c248 commit 9621515
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 78 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/src/dd_main.cpp
Expand Up @@ -1897,7 +1897,7 @@ boolean DD_Init(void)
LOG_MSG("Additional (pre-init) config file \"%s\"") << F_PrettyPath(arg);
Con_ParseCommands(arg);
}
LOG_DEBUG(String("Completed in %1 seconds").arg(begunAt.since(), 0, 'g', 2));
LOG_SCR_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

// A console command on the command line?
Expand Down Expand Up @@ -2032,7 +2032,7 @@ static int DD_StartupWorker(void * /*context*/)
LOG_MSG("Additional (pre-init) config file \"%s\"") << F_PrettyPath(arg);
Con_ParseCommands(arg);
}
LOG_DEBUG(String("Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_SCR_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

/*
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/def_main.cpp
Expand Up @@ -916,7 +916,7 @@ static void readAllDefinitions()
*/
Def_ReadLumpDefs();

LOG_RES_VERBOSE(String("readAllDefinitions: Completed in %1 seconds").arg(begunAt.since(), 0, 'g', 2));
LOG_RES_VERBOSE("readAllDefinitions: Completed in %.2f seconds") << begunAt.since();
}

static AnimGroup const *findAnimGroupForTexture(TextureManifest &textureManifest)
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/filesys/fs_main.cpp
Expand Up @@ -558,7 +558,7 @@ de::File1& FS1::find(de::Uri const& search)
catch(de::Uri::ResolveError const& er)
{
// Log but otherwise ignore unresolved paths.
LOG_RES_VERBOSE(er.asText());
LOGDEV_RES_VERBOSE(er.asText());
}
}

Expand Down Expand Up @@ -606,7 +606,7 @@ String FS1::findPath(de::Uri const& search, int flags, ResourceClass& rclass)
catch(de::Uri::ResolveError const& er)
{
// Log but otherwise ignore unresolved paths.
LOG_DEBUG(er.asText());
LOGDEV_RES_VERBOSE(er.asText());
}
}

Expand Down Expand Up @@ -994,7 +994,7 @@ bool FS1::accessFile(de::Uri const& search)
catch(de::Uri::ResolveError const& er)
{
// Log but otherwise ignore unresolved paths.
LOG_RES_VERBOSE(er.asText());
LOGDEV_RES_VERBOSE(er.asText());
}
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/filesys/fs_scheme.cpp
Expand Up @@ -208,7 +208,7 @@ struct FS1::Scheme::Instance
}
catch(de::Uri::ResolveError const &er)
{
LOG_RES_VERBOSE(er.asText());
LOGDEV_RES_VERBOSE(er.asText());
}
}

Expand Down Expand Up @@ -354,7 +354,7 @@ void FS1::Scheme::rebuild()
LOG_AS("Scheme::rebuild");
LOGDEV_RES_MSG("Rebuilding '%s'...") << d->name;

// uint startTime = Timer_RealMilliseconds();
Time begunAt;

// (Re)populate the directory and add found files.
clear();
Expand All @@ -365,7 +365,7 @@ void FS1::Scheme::rebuild()

d->nameHashIsDirty = false;

// LOG_INFO("Completed in %.2f seconds.") << (Timer_RealMilliseconds() - startTime) / 1000.0f;
LOGDEV_RES_VERBOSE("Completed in %.2f seconds") << begunAt.since();

/*#if _DEBUG
PathTree::debugPrint(d->directory);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/gl/gl_main.cpp
Expand Up @@ -306,7 +306,7 @@ boolean GL_EarlyInit()
if(novideo) return true;
if(initGLOk) return true; // Already initialized.

LOG_GL_NOTE("Initializing Render subsystem...");
LOG_GL_MSG("Initializing Render subsystem...");

gamma_support = !CommandLine_Check("-noramp");

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/lightgrid.cpp
Expand Up @@ -800,7 +800,7 @@ DENG2_OBSERVES(Sector, LightLevelChange)
self.markAllForUpdate();

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

/**
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/r_fakeradio.cpp
Expand Up @@ -260,5 +260,5 @@ void Rend_RadioInitForMap(Map &map)
}
}

LOG_GL_MSG(String("Completed in %1 seconds").arg(begunAt.since(), 0, 'g', 2));
LOG_GL_MSG("Completed in %1 seconds") << begunAt.since();
}
4 changes: 2 additions & 2 deletions doomsday/client/src/resource/compositebitmapfont.cpp
Expand Up @@ -227,7 +227,7 @@ CompositeBitmapFont *CompositeBitmapFont::fromDef(FontManifest &manifest,
}
catch(de::Uri::ResolveError const &er)
{
LOG_WARNING(er.asText());
LOG_RES_WARNING(er.asText());
}
}

Expand Down Expand Up @@ -264,7 +264,7 @@ void CompositeBitmapFont::rebuildFromDef(ded_compositefont_t const &newDef)
}
catch(de::Uri::ResolveError const& er)
{
LOG_WARNING(er.asText());
LOG_RES_WARNING(er.asText());
}
}
}
12 changes: 6 additions & 6 deletions doomsday/client/src/resource/resourcesystem.cpp
Expand Up @@ -2069,15 +2069,15 @@ void ResourceSystem::initCompositeTextures()
Time begunAt;

LOG_AS("ResourceSystem");
LOG_VERBOSE("Initializing PatchComposite textures...");
LOG_RES_VERBOSE("Initializing PatchComposite textures...");

// Load texture definitions from TEXTURE1/2 lumps.
CompositeTextures texs = d->loadCompositeTextureDefs();
d->processCompositeTextureDefs(texs);

DENG_ASSERT(texs.isEmpty());

LOG_INFO(String("initCompositeTextures: Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_RES_VERBOSE("initCompositeTextures: Completed in %.2f seconds") << begunAt.since();
}

void ResourceSystem::initFlatTextures()
Expand Down Expand Up @@ -2150,7 +2150,7 @@ void ResourceSystem::initFlatTextures()
/// @todo Defer until necessary (manifest texture is first referenced).
d->deriveAllTexturesInScheme("Flats");

LOG_INFO(String("initFlatTextures: Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_RES_VERBOSE("initFlatTextures: Completed in %.2f seconds") << begunAt.since();
}

/// Returns a value in the range [0..Sprite::max_angles] if @a rotCode can be
Expand Down Expand Up @@ -2313,7 +2313,7 @@ void ResourceSystem::initSpriteTextures()
/// @todo Defer until necessary (manifest texture is first referenced).
d->deriveAllTexturesInScheme("Sprites");

LOG_INFO(String("initSpriteTextures: Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_RES_VERBOSE("initSpriteTextures: Completed in %.2f seconds") << begunAt.since();
}

Texture *ResourceSystem::texture(String schemeName, de::Uri const *resourceUri)
Expand Down Expand Up @@ -3292,7 +3292,7 @@ void ResourceSystem::initModels()
me->selectNext = closest;
}

LOG_INFO(String("Model init completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_RES_MSG("Model init completed in %.2f seconds") << begunAt.since();
}

int ResourceSystem::indexOf(ModelDef const *modelDef)
Expand Down Expand Up @@ -3553,7 +3553,7 @@ void ResourceSystem::initSprites()
// We're done with the definitions.
defs.clear();

LOG_INFO(String("Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_RES_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

void ResourceSystem::clearAllColorPalettes()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/resource/zip.cpp
Expand Up @@ -452,7 +452,7 @@ struct Zip::Instance
}
catch(de::Uri::ResolveError const& er)
{
LOG_WARNING(er.asText());
LOG_RES_WARNING(er.asText());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/sys_system.cpp
Expand Up @@ -81,7 +81,7 @@ void Sys_Init(void)
{
uint startTime;

LOG_NOTE("Setting up platform state...");
LOG_MSG("Setting up platform state...");

startTime = (verbose >= 2? Timer_RealMilliseconds() : 0);

Expand All @@ -107,7 +107,7 @@ void Sys_Init(void)
LOG_NET_VERBOSE("Initializing Network subsystem...");
N_Init();

LOG_XVERBOSE("Sys_Init completed in %.2f seconds") << (Timer_RealMilliseconds() - startTime) / 1000.0f;
LOGDEV_VERBOSE("Sys_Init completed in %.2f seconds") << (Timer_RealMilliseconds() - startTime) / 1000.0f;
}

boolean Sys_IsShuttingDown(void)
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/world/map.cpp
Expand Up @@ -1220,7 +1220,7 @@ void Map::initBias()
addBiasSource(BiasSource::fromDef(*def));
}

LOG_INFO(String("Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_MAP_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

void Map::unlinkInMaterialLists(Surface *surface)
Expand Down Expand Up @@ -1454,7 +1454,7 @@ void Map::initNodePiles()
}

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

Blockmap const &Map::mobjBlockmap() const
Expand Down Expand Up @@ -2168,7 +2168,7 @@ void Map::initSkyFix()
}
}

LOG_INFO(String("Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_MAP_VERBOSE("Completed in %.2f seconds.") << begunAt.since();
}

coord_t Map::skyFix(bool ceiling) const
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/world/p_particle.cpp
Expand Up @@ -189,7 +189,7 @@ void P_PtcInitForMap(Map &map)
P_SpawnTypeParticleGens();
P_SpawnMapParticleGens(map);

LOG_INFO(String("Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2));
LOG_MAP_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

/// @todo fixme: Do not assume the current map.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/world/world.cpp
Expand Up @@ -679,7 +679,7 @@ DENG2_PIMPL(World)
Time begunPrecacheAt;
App_ResourceSystem().cacheForCurrentMap();
App_ResourceSystem().processCacheQueue();
LOG_INFO(String("Precaching completed in %1 seconds.").arg(begunPrecacheAt.since(), 0, 'g', 2));
LOG_RES_VERBOSE("Precaching completed in %.2f seconds") << begunPrecacheAt.since();

ClientApp::renderSystem().clearDrawLists();
R_InitRendPolyPools();
Expand Down
28 changes: 14 additions & 14 deletions doomsday/libdeng2/src/data/bank.cpp
Expand Up @@ -144,7 +144,7 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai

if(data.get())
{
LOG_VERBOSE("Item \"%s\" data cleared from memory (%i bytes)")
LOG_RES_VERBOSE("Item \"%s\" data cleared from memory (%i bytes)")
<< path('.') << data->sizeInMemory();
data->aboutToUnload();
data.reset();
Expand Down Expand Up @@ -193,7 +193,7 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai
// us. This may take an unspecified amount of time.
QScopedPointer<IData> loaded(bank->loadFromSource(*source));

LOG_TRACE("Loaded \"%s\" from source in %.2f seconds") << path('.') << startedAt.since();
LOG_RES_XVERBOSE("Loaded \"%s\" from source in %.2f seconds") << path('.') << startedAt.since();

if(loaded.data())
{
Expand Down Expand Up @@ -225,14 +225,14 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai
QScopedPointer<IData> blank(bank->newData());
reader >> *blank->asSerializable();
setData(blank.take());
LOG_TRACE("Deserialized \"%s\" in %.2f seconds") << path('.') << startedAt.since();
LOG_RES_XVERBOSE("Deserialized \"%s\" in %.2f seconds") << path('.') << startedAt.since();
return; // Done!
}
// We cannot use this.
}
catch(Error const &er)
{
LOG_WARNING("Failed to deserialize \"%s\":\n") << path('.') << er.asText();
LOG_RES_WARNING("Failed to deserialize \"%s\":\n") << path('.') << er.asText();
}

// Fallback option.
Expand Down Expand Up @@ -304,7 +304,7 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai
// Externally we use dotted paths.
Path const itemPath = path('.');

LOG_TRACE("Item \"%s\" moved to %s cache")
LOGDEV_RES_XVERBOSE("Item \"%s\" moved to %s cache")
<< itemPath << Cache::formatAsText(toCache.format());

bank->d->notify(Notification(itemPath, toCache));
Expand Down Expand Up @@ -462,7 +462,7 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai
}
catch(Error const &er)
{
LOG_WARNING("Failed to load \"%s\" from source:\n") << _path << er.asText();
LOG_RES_WARNING("Failed to load \"%s\" from source:\n") << _path << er.asText();
}
// Ensure a blocking load completes.
item().post();
Expand All @@ -474,12 +474,12 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai
{
DENG2_ASSERT(_bank.d->serialCache != 0);

LOG_DEBUG("Serializing \"%s\"") << _path;
LOG_RES_XVERBOSE("Serializing \"%s\"") << _path;
item().changeCache(*_bank.d->serialCache);
}
catch(Error const &er)
{
LOG_WARNING("Failed to serialize \"%s\" to hot storage:\n")
LOG_RES_WARNING("Failed to serialize \"%s\" to hot storage:\n")
<< _path << er.asText();
}
}
Expand All @@ -488,12 +488,12 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai
{
try
{
LOG_DEBUG("Unloading \"%s\"") << _path;
LOGDEV_RES_XVERBOSE("Unloading \"%s\"") << _path;
item().changeCache(_bank.d->sourceCache);
}
catch(Error const &er)
{
LOG_WARNING("Error when unloading \"%s\":\n")
LOG_RES_WARNING("Error when unloading \"%s\":\n")
<< _path << er.asText();
}
}
Expand Down Expand Up @@ -637,7 +637,7 @@ DENG2_OBSERVES(Loop, Iteration) // notifications from other threads sent via mai

if(item.isValidSerialTime(hotTime))
{
LOG_VERBOSE("Found valid serialized copy of \"%s\"") << item.path('.');
LOGDEV_RES_MSG("Found valid serialized copy of \"%s\"") << item.path('.');

item.serial = array;
best = serialCache;
Expand Down Expand Up @@ -854,7 +854,7 @@ Bank::IData &Bank::data(DotPath const &path) const
item.reset();
item.unlock();

LOG_TRACE("Loading \"%s\"...") << path;
LOG_RES_XVERBOSE("Loading \"%s\"...") << path;

Time requestedAt;
d->load(path, Immediately);
Expand All @@ -863,11 +863,11 @@ Bank::IData &Bank::data(DotPath const &path) const
TimeDelta const waitTime = requestedAt.since();
if(waitTime > 0.0)
{
LOG_DEBUG("\"%s\" loaded (waited %.3f seconds)") << path << waitTime;
LOG_RES_VERBOSE("\"%s\" loaded (waited %.3f seconds)") << path << waitTime;
}
else
{
LOG_DEBUG("\"%s\" loaded") << path;
LOG_RES_VERBOSE("\"%s\" loaded") << path;
}

item.lock();
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libgui/src/atlas.cpp
Expand Up @@ -344,13 +344,13 @@ void Atlas::commit() const
if(d->mustCommitFull())
{
DENG2_ASSERT(d->backing.size() == d->totalSize);
LOG_GL_XVERBOSE("Full commit ") << d->backing.size().asText();
LOGDEV_GL_XVERBOSE("Full commit ") << d->backing.size().asText();

commitFull(d->backing);
}
else
{
LOG_GL_XVERBOSE("Partial commit ") << d->changedArea.asText();
LOGDEV_GL_XVERBOSE("Partial commit ") << d->changedArea.asText();

// An extra copy is done to crop to the changed area.
commit(d->backing.subImage(d->changedArea), d->changedArea.topLeft);
Expand Down

0 comments on commit 9621515

Please sign in to comment.