Replace DLOG() with TRACE()

This commit is contained in:
David Capello 2015-12-21 12:30:21 -03:00
parent fcbb364085
commit 3bcda8c1b1
4 changed files with 30 additions and 35 deletions

View File

@ -28,7 +28,7 @@ Cmd::~Cmd()
void Cmd::execute(Context* ctx)
{
DLOG("Cmd: Executing cmd '%s'\n", typeid(*this).name());
TRACE("Cmd: Executing cmd '%s'\n", typeid(*this).name());
ASSERT(m_state == State::NotExecuted);
m_ctx = ctx;
@ -43,7 +43,7 @@ void Cmd::execute(Context* ctx)
void Cmd::undo()
{
DLOG("Cmd: Undo cmd '%s'\n", typeid(*this).name());
TRACE("Cmd: Undo cmd '%s'\n", typeid(*this).name());
ASSERT(m_state == State::Executed || m_state == State::Redone);
onUndo();
@ -56,7 +56,7 @@ void Cmd::undo()
void Cmd::redo()
{
DLOG("Cmd: Redo cmd '%s'\n", typeid(*this).name());
TRACE("Cmd: Redo cmd '%s'\n", typeid(*this).name());
ASSERT(m_state == State::Undone);
onRedo();

View File

@ -189,10 +189,10 @@ public:
, m_remap(256)
, m_hasLocalColormaps(false)
, m_firstLocalColormap(nullptr) {
DLOG("[GifDecoder] GIF background index=%d\n", (int)m_gifFile->SBackGroundColor);
DLOG("[GifDecoder] GIF global colormap=%d, ncolors=%d\n",
(m_gifFile->SColorMap ? 1: 0),
(m_gifFile->SColorMap ? m_gifFile->SColorMap->ColorCount: 0));
TRACE("[GifDecoder] GIF background index=%d\n", (int)m_gifFile->SBackGroundColor);
TRACE("[GifDecoder] GIF global colormap=%d, ncolors=%d\n",
(m_gifFile->SColorMap ? 1: 0),
(m_gifFile->SColorMap ? m_gifFile->SColorMap->ColorCount: 0));
}
~GifDecoder() {
@ -310,7 +310,7 @@ private:
UniquePtr<Image> frameImage(
readFrameIndexedImage(frameBounds));
DLOG("[GifDecoder] Frame[%d] transparent index = %d\n", (int)m_frameNum, m_localTransparentIndex);
TRACE("[GifDecoder] Frame[%d] transparent index = %d\n", (int)m_frameNum, m_localTransparentIndex);
if (m_frameNum == 0) {
if (m_localTransparentIndex >= 0)
@ -325,8 +325,8 @@ private:
// Convert the sprite to RGB if we have more than 256 colors
if ((m_sprite->pixelFormat() == IMAGE_INDEXED) &&
(m_sprite->palette(m_frameNum)->size() > 256)) {
DLOG("[GifDecoder] Converting to RGB because we have %d colors\n",
m_sprite->palette(m_frameNum)->size());
TRACE("[GifDecoder] Converting to RGB because we have %d colors\n",
m_sprite->palette(m_frameNum)->size());
convertIndexedSpriteToRgb();
}
@ -444,7 +444,7 @@ private:
int ncolors = colormap->ColorCount;
bool isLocalColormap = (m_gifFile->Image.ColorMap ? true: false);
DLOG("[GifDecoder] Local colormap=%d, ncolors=%d\n", isLocalColormap, ncolors);
TRACE("[GifDecoder] Local colormap=%d, ncolors=%d\n", isLocalColormap, ncolors);
// We'll calculate the list of used colormap indexes in this
// frameImage.
@ -527,17 +527,17 @@ private:
// Number of colors in the image that aren't in the palette.
int missing = (usedNColors - found);
DLOG("[GifDecoder] Bg index=%d,\n"
" Local transparent index=%d,\n"
" Need extra index to show bg color=%d,\n "
" Found colors in palette=%d,\n"
" Used colors in local pixels=%d,\n"
" Base for new colors in palette=%d,\n"
" Colors in the image missing in the palette=%d,\n"
" New palette size=%d\n",
m_bgIndex, m_localTransparentIndex, needsExtraBgColor,
found, usedNColors, base, missing,
base + missing + (needsExtraBgColor ? 1: 0));
TRACE("[GifDecoder] Bg index=%d,\n"
" Local transparent index=%d,\n"
" Need extra index to show bg color=%d,\n "
" Found colors in palette=%d,\n"
" Used colors in local pixels=%d,\n"
" Base for new colors in palette=%d,\n"
" Colors in the image missing in the palette=%d,\n"
" New palette size=%d\n",
m_bgIndex, m_localTransparentIndex, needsExtraBgColor,
found, usedNColors, base, missing,
base + missing + (needsExtraBgColor ? 1: 0));
Palette oldPalette(*palette);
palette->resize(base + missing + (needsExtraBgColor ? 1: 0));
@ -645,8 +645,8 @@ private:
m_localTransparentIndex = (extension[1] & 1) ? extension[4]: -1;
m_frameDelay = (extension[3] << 8) | extension[2];
DLOG("[GifDecoder] Disposal method: %d\n Transparent index: %d\n Frame delay: %d\n",
m_disposalMethod, m_localTransparentIndex, m_frameDelay);
TRACE("[GifDecoder] Disposal method: %d\n Transparent index: %d\n Frame delay: %d\n",
m_disposalMethod, m_localTransparentIndex, m_frameDelay);
}
}
@ -1046,10 +1046,10 @@ private:
}
}
DLOG("[GifEncoder] frameBounds=%d %d %d %d prev=%d %d %d %d next=%d %d %d %d\n",
frameBounds.x, frameBounds.y, frameBounds.w, frameBounds.h,
prev.x, prev.y, prev.w, prev.h,
next.x, next.y, next.w, next.h);
TRACE("[GifEncoder] frameBounds=%d %d %d %d prev=%d %d %d %d next=%d %d %d %d\n",
frameBounds.x, frameBounds.y, frameBounds.w, frameBounds.h,
prev.x, prev.y, prev.w, prev.h,
next.x, next.y, next.w, next.h);
}
}

View File

@ -36,11 +36,6 @@
#define COPYRIGHT "Copyright (C) 2001-2015 David Capello"
#define LOG verbose_log
#ifdef _DEBUG
#define DLOG LOG
#else
#define DLOG(...) ((void)0)
#endif
// verbose_log() is defined in src/app/log.cpp and used through LOG macro
void verbose_log(const char* format, ...);

View File

@ -117,8 +117,8 @@ public:
HttpResponse response(&body);
request.send(response);
DLOG("Checking updates: %s (User-Agent: %s)\n", url.c_str(), getUserAgent().c_str());
DLOG("Response:\n--\n%s--\n", body.str().c_str());
TRACE("Checking updates: %s (User-Agent: %s)\n", url.c_str(), getUserAgent().c_str());
TRACE("Response:\n--\n%s--\n", body.str().c_str());
CheckUpdateResponse data(body.str());
delegate->onResponse(data);