Skip to content

Commit

Permalink
Cleanup|All Games|Plugins: Replacing use of Con_Message with App_Log
Browse files Browse the repository at this point in the history
Applying log entry metadata flags.
  • Loading branch information
skyjake committed Jan 12, 2014
1 parent ad93df0 commit 6cec9bb
Show file tree
Hide file tree
Showing 68 changed files with 453 additions and 1,642 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/include/m_profiler.h
Expand Up @@ -44,7 +44,7 @@ typedef struct profiler_s {
# define END_PROF_TIMERS() ,NUM_PROFS }; static profiler_t profiler_[NUM_PROFS];
# define BEGIN_PROF(x) (profiler_[x].startCount++, profiler_[x].startTime = Timer_RealMilliseconds())
# define END_PROF(x) (profiler_[x].totalTime += Timer_RealMilliseconds() - profiler_[x].startTime)
# define PRINT_PROF(x) Con_Message("[%f ms] " #x ": %i ms (%i starts)", \
# define PRINT_PROF(x) App_Log(DE2_LOG_DEV, "[%f ms] " #x ": %i ms (%i starts)", \
profiler_[x].startCount? profiler_[x].totalTime / \
(float) profiler_[x].startCount : 0, \
profiler_[x].totalTime, profiler_[x].startCount)
Expand Down
9 changes: 9 additions & 0 deletions doomsday/client/include/ui/styledlogsinkformatter.h
Expand Up @@ -33,8 +33,17 @@ class StyledLogSinkFormatter : public de::LogSink::IFormatter

Lines logEntryToTextLines(de::LogEntry const &entry);

/**
* Omits the log entry section information if the entry is marked as
* a non-developer entry. The default is @c true.
*
* @param omit Omit section.
*/
void setOmitSectionIfNonDev(bool omit);

private:
de::LogEntry::Flags _format;
bool _omitSectionIfNonDev;
};

#endif // DENG_CLIENT_STYLEDLOGSINKFORMATTER_H
2 changes: 1 addition & 1 deletion doomsday/client/src/audio/s_main.cpp
Expand Up @@ -612,7 +612,7 @@ D_CMD(PlaySound)

if(argc < 2)
{
LOG_SCR_MSG("Usage: %s (id) (volume) at (x) (y) (z)") << argv[0];
LOG_SCR_NOTE("Usage: %s (id) (volume) at (x) (y) (z)") << argv[0];
LOG_SCR_MSG("(volume) must be in 0..1, but may be omitted.");
LOG_SCR_MSG("'at (x) (y) (z)' may also be omitted.");
LOG_SCR_MSG("The sound is always played locally.");
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/audio/s_mus.cpp
Expand Up @@ -473,7 +473,7 @@ D_CMD(PlayMusic)
switch(argc)
{
default:
LOG_SCR_MSG("Usage:\n %s (music-def)") << argv[0];
LOG_SCR_NOTE("Usage:\n %s (music-def)") << argv[0];
LOG_SCR_MSG(" %s lump (lumpname)") << argv[0];
LOG_SCR_MSG(" %s file (filename)") << argv[0];
LOG_SCR_MSG(" %s cd (track)") << argv[0];
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/audio/s_wav.cpp
Expand Up @@ -200,7 +200,7 @@ void* WAV_Load(const char* filename, int* bits, int* rate, int* samples)
size = FileHandle_Length(file);

LOG_AS("WAV_Load");
LOG_RES_XVERBOSE("Loading from \"%s\" (size %i, fpos %i)")
LOGDEV_RES_XVERBOSE("Loading from \"%s\" (size %i, fpos %i)")
<< F_PrettyPath(Str_Text(F_ComposePath(FileHandle_File_const(file))))
<< size
<< FileHandle_Tell(file);
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/clientapp.cpp
Expand Up @@ -151,6 +151,7 @@ DENG2_PIMPL(ClientApp)
: LogSink(formatter)
, formatter(LogEntry::Styled | LogEntry::OmitLevel | LogEntry::Simple)
{
//formatter.setOmitSectionIfNonDev(false); // always show section
setMode(OnlyWarningEntries);
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/dd_main.cpp
Expand Up @@ -1902,7 +1902,7 @@ dd_bool DD_Init(void)
LOG_MSG("Additional (pre-init) config file \"%s\"") << F_PrettyPath(arg);
Con_ParseCommands(arg);
}
LOG_SCR_VERBOSE("Completed in %.2f seconds") << begunAt.since();
LOGDEV_SCR_VERBOSE("Completed in %.2f seconds") << begunAt.since();
}

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

/*
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/gl/gl_draw.cpp
Expand Up @@ -315,7 +315,7 @@ DENG_EXTERN_C void GL_SetFilterColor(float r, float g, float b, float a)
filterColor = newColorClamped;

LOG_AS("GL_SetFilterColor");
LOG_GL_XVERBOSE("%s") << filterColor.asText();
LOGDEV_GL_XVERBOSE("%s") << filterColor.asText();
}
}

Expand Down
3 changes: 2 additions & 1 deletion doomsday/client/src/gl/gl_main.cpp
Expand Up @@ -908,7 +908,8 @@ static void uploadContentUnmanaged(texturecontent_t const &content)
gl::UploadMethod uploadMethod = GL_ChooseUploadMethod(&content);
if(uploadMethod == gl::Immediate)
{
LOG_GL_XVERBOSE("Uploading texture (%i:%ix%i) while not busy! Should have been precached in busy mode?")
LOGDEV_GL_XVERBOSE("Uploading texture (%i:%ix%i) while not busy! "
"Should have been precached in busy mode?")
<< content.name << content.width << content.height;
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/gl/gl_texmanager.cpp
Expand Up @@ -109,7 +109,7 @@ void GL_TexReset()
if(!initedOk) return;

App_ResourceSystem().releaseAllGLTextures();
LOG_GL_MSG("All GL textures deleted");
LOG_GL_VERBOSE("Released all GL textures");

bool useBusyMode = !BusyMode_Active();
if(useBusyMode)
Expand Down Expand Up @@ -397,5 +397,5 @@ void GL_ReleaseTexturesForRawImages()
raw->tex = 0;
}
}
LOG_GL_MSG("All GL textures for RawTextures deleted");
LOG_GL_VERBOSE("Released all GL textures for raw images");
}
2 changes: 1 addition & 1 deletion doomsday/client/src/gl/texturecontent.cpp
Expand Up @@ -372,7 +372,7 @@ void GL_PrepareTextureContent(texturecontent_t &c, GLuint glTexName,

// Announce the normalization.
de::Uri uri = textureManifest.composeUri();
LOG_GL_VERBOSE("Normalized detail texture \"%s\" (balance: %g, high amp: %g, low amp: %g)")
LOG_GL_VERBOSE("Normalized detail texture \"%s\" (balance: %f, high amp: %f, low amp: %f)")
<< uri << baMul << hiMul << loMul;
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/fx/lensflares.cpp
Expand Up @@ -84,7 +84,7 @@ struct FlareData
DENG_ASSERT_IN_MAIN_THREAD();
DENG_ASSERT_GL_CONTEXT_ACTIVE();

LOG_GL_XVERBOSE("Releasing shared data");
LOGDEV_GL_XVERBOSE("Releasing shared data");
}

static Image const &flareImage(String const &name)
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/render/fx/postprocessing.cpp
Expand Up @@ -127,7 +127,7 @@ DENG2_PIMPL(PostProcessing)

void glDeinit()
{
LOG_DEBUG("Releasing GL resources");
LOGDEV_GL_XVERBOSE("Releasing GL resources");
framebuf.glDeinit();
}

Expand All @@ -154,7 +154,7 @@ DENG2_PIMPL(PostProcessing)
}
}
fade.setValue(entry.fade, entry.span);
LOG_GL_XVERBOSE("%s %s") << entry.shaderName << fade.asText();
LOGDEV_GL_VERBOSE("Shader '%s' fade:%s") << entry.shaderName << fade.asText();
}
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/render/lightgrid.cpp
Expand Up @@ -696,7 +696,7 @@ DENG2_OBSERVES(Sector, LightLevelChange)
sector->audienceForLightColorChange += this;
}

LOG_GL_MSG("%i light blocks (%u bytes)")
LOGDEV_GL_MSG("%i light blocks (%u bytes)")
<< numBlocks << (sizeof(LightBlock) * numBlocks);

// We're done with sector samples completely.
Expand Down Expand Up @@ -800,7 +800,7 @@ DENG2_OBSERVES(Sector, LightLevelChange)
self.markAllForUpdate();

// How much time did we spend?
LOG_GL_MSG("Completed in %.2f seconds") << begunAt.since();
LOGDEV_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("Completed in %.2f seconds") << begunAt.since();
LOGDEV_GL_MSG("Completed in %.2f seconds") << begunAt.since();
}
6 changes: 3 additions & 3 deletions doomsday/client/src/render/rend_halo.cpp
Expand Up @@ -393,9 +393,9 @@ D_CMD(FlareConfig)
}
else
{
LOG_SCR_MSG("Usage:\n"
" %s list\n"
" %s (num) pos/size/alpha/tex (val)") << argv[0] << argv[0];
LOG_SCR_NOTE("Usage:\n"
" %s list\n"
" %s (num) pos/size/alpha/tex (val)") << argv[0] << argv[0];
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/rend_main.cpp
Expand Up @@ -323,7 +323,7 @@ static void texGammaChanged()
{
R_BuildTexGammaLut();
GL_TexReset();
//LOG_MSG("Gamma correction set to %f.") << texGamma;
LOG_GL_MSG("Texture gamma correction set to %f") << texGamma;
}

static void mipmappingChanged()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/rend_model.cpp
Expand Up @@ -175,7 +175,7 @@ bool Rend_ModelExpandVertexBuffers(uint numVertices)
#ifdef DENG_DEBUG
if(!announcedVertexBufferMaxBreach)
{
LOG_WARNING("Attempted to expand to %u vertices (max %u), ignoring.")
LOGDEV_GL_WARNING("Attempted to expand to %u vertices (max %u)")
<< numVertices << RENDER_MAX_MODEL_VERTS;
announcedVertexBufferMaxBreach = true;
}
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/render/rend_particle.cpp
Expand Up @@ -149,7 +149,7 @@ static byte loadParticleTexture(uint particleTex)
image_t image;
if(!GL_LoadImage(image, foundPath.toUtf8().constData()))
{
LOG_WARNING("Failed to load \"%s\"") << foundPath;
LOG_RES_WARNING("Failed to load \"%s\"") << foundPath;
return 0;
}

Expand Down Expand Up @@ -214,7 +214,7 @@ void Rend_ParticleLoadExtraTextures()

if(!loaded.isEmpty())
{
LOG_INFO("Loaded textures for particle IDs: %s") << Rangei::contiguousRangesAsText(loaded);
LOG_GL_NOTE("Loaded textures for particle IDs: %s") << Rangei::contiguousRangesAsText(loaded);
}
}

Expand Down
10 changes: 5 additions & 5 deletions doomsday/client/src/render/sky.cpp
Expand Up @@ -574,7 +574,7 @@ void Sky::configure(ded_sky_t *def)
catch(ResourceSystem::MissingManifestError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ". Unknown material \"%s\" in definition layer %i, using default.")
LOG_RES_WARNING(er.asText() + ". Unknown material \"%s\" in definition layer %i, using default.")
<< *matUri << i;
}
}
Expand Down Expand Up @@ -1001,15 +1001,15 @@ static void setSkyLayerParams(Sky &sky, int layerIndex, int param, void *data)

default:
// Log but otherwise ignore this error.
LOG_WARNING("Bad parameter %i. Failed configuring sky layer #%i, ignoring.")
<< param << layerIndex;
LOG_GL_WARNING("Failed configuring sky layer #%i: bad parameter %i")
<< layerIndex << param;
}
}
catch(Sky::MissingLayerError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ". Failed configuring sky layer #%i, ignoring.")
<< layerIndex;
LOG_GL_WARNING("Failed configuring sky layer #%i: %s")
<< layerIndex << er.asText();
}
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/render/walledge.cpp
Expand Up @@ -469,7 +469,7 @@ DENG2_PIMPL(WallEdge), public IHPlane
EventIndex index = 0;
foreach(Event const *icpt, *events)
{
LOG_DEBUG(" %u: >%1.2f ") << (index++) << icpt->distance();
LOGDEV_MAP_MSG(" %u: >%1.2f ") << (index++) << icpt->distance();
}
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/resource/api_material.cpp
Expand Up @@ -20,12 +20,12 @@ DENG_EXTERN_C Material *DD_MaterialForTextureUri(uri_s const *textureUri)
catch(MaterialManifest::MissingMaterialError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
catch(ResourceSystem::UnknownSchemeError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
catch(ResourceSystem::MissingManifestError const &)
{} // Ignore this error.
Expand Down
28 changes: 14 additions & 14 deletions doomsday/client/src/resource/api_resource.cpp
Expand Up @@ -45,7 +45,7 @@ DENG_EXTERN_C int Textures_UniqueId2(uri_s const *_uri, dd_bool quiet)
// Log but otherwise ignore this error.
if(!quiet)
{
LOG_WARNING("Unknown texture %s.") << uri;
LOG_RES_WARNING("Unknown texture %s") << uri;
}
}
return -1;
Expand Down Expand Up @@ -85,7 +85,7 @@ DENG_EXTERN_C void R_AddAnimGroupFrame(int groupId, uri_s const *textureUri_, in
catch(ResourceSystem::MissingManifestError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ". Failed adding texture \"%s\" to group #%i, ignoring.")
LOG_RES_WARNING(er.asText() + ". Failed adding texture \"%s\" to group #%i, ignoring.")
<< textureUri << groupId;
}
}
Expand All @@ -101,7 +101,7 @@ DENG_EXTERN_C colorpaletteid_t R_CreateColorPalette(char const *colorFormatDescr
String name(nameCStr);
if(name.isEmpty())
{
LOG_WARNING("Invalid/zero-length name specified, ignoring.");
LOG_RES_WARNING("Invalid/zero-length name specified, ignoring.");
return 0;
}

Expand All @@ -126,7 +126,7 @@ DENG_EXTERN_C colorpaletteid_t R_CreateColorPalette(char const *colorFormatDescr
}
catch(ColorTableReader::FormatError const &er)
{
LOG_WARNING("Error creating/replacing color palette '%s':\n")
LOG_RES_WARNING("Error creating/replacing color palette '%s':\n")
<< name << er.asText();
}
return 0;
Expand Down Expand Up @@ -160,13 +160,13 @@ DENG_EXTERN_C void R_CreateColorPaletteTranslation(colorpaletteid_t paletteId,
catch(ResourceSystem::MissingResourceError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING("Error creating/replacing color palette '%u' translation '%s':\n")
LOG_RES_WARNING("Error creating/replacing color palette '%u' translation '%s':\n")
<< paletteId << Str_Text(translationId) << er.asText();
}
catch(ColorPalette::InvalidTranslationIdError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING("Error creating/replacing color palette '%u' translation '%s':\n")
LOG_RES_WARNING("Error creating/replacing color palette '%u' translation '%s':\n")
<< paletteId << Str_Text(translationId) << er.asText();
}
}
Expand All @@ -182,7 +182,7 @@ DENG_EXTERN_C colorpaletteid_t R_GetColorPaletteNumForName(char const *name)
catch(ResourceSystem::MissingResourceError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
return 0; // Not found.
}
Expand All @@ -199,7 +199,7 @@ DENG_EXTERN_C char const *R_GetColorPaletteNameForNum(colorpaletteid_t id)
catch(ResourceSystem::MissingResourceError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
return 0; // Not found.
}
Expand Down Expand Up @@ -235,7 +235,7 @@ DENG_EXTERN_C void R_GetColorPaletteRGBubv(colorpaletteid_t paletteId, int color
catch(ResourceSystem::MissingResourceError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
}

Expand Down Expand Up @@ -275,7 +275,7 @@ DENG_EXTERN_C void R_GetColorPaletteRGBf(colorpaletteid_t paletteId, int colorId
catch(ResourceSystem::MissingResourceError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
}

Expand All @@ -291,7 +291,7 @@ DENG_EXTERN_C AutoStr *R_ComposePatchPath(patchid_t id)
catch(TextureScheme::NotFoundError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
return AutoStr_NewStd();
}
Expand All @@ -307,7 +307,7 @@ DENG_EXTERN_C uri_s *R_ComposePatchUri(patchid_t id)
catch(TextureScheme::NotFoundError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
return reinterpret_cast<uri_s *>(new de::Uri());
}
Expand Down Expand Up @@ -359,12 +359,12 @@ DENG_EXTERN_C dd_bool R_GetPatchInfo(patchid_t id, patchinfo_t *info)
catch(TextureManifest::MissingTextureError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
catch(TextureScheme::NotFoundError const &er)
{
// Log but otherwise ignore this error.
LOG_WARNING(er.asText() + ", ignoring.");
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
return false;
}
Expand Down

0 comments on commit 6cec9bb

Please sign in to comment.