flDebug.h File Reference

#include "flGlobal.h"
#include <stdarg.h>

Go to the source code of this file.

Defines

#define DEBUG_ARGEXTEND   256
 The minimum amount to extend a debug message strings length by, in order to make room for the extra arguments that will be inserted into it.
#define debugError(inMessage,...)   debugErrorFrom(__FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)
#define debugWarning(inMessage,...)   debugWarningFrom(__FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)
#define debugDevWarning(inMessage,...)   debugDevWarningFrom(__FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)
#define debugCriticalError(inMessage,...)   debugCriticalErrorFrom(__FILE__, __FUNCTION__, __LINE__, ## inMessage, __VA_ARGS__)
#define debugStatusLog(inMessage,...)   debugStatusLogFrom( __FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)

Functions

void debugInit ()
void debugErrorFrom (const char *inFile, const char *inFunc, int inLine, char *inMessage,...)
void debugWarningFrom (const char *inFile, const char *inFunc, int inLine, char *inMessage,...)
void debugDevWarningFrom (const char *inFile, const char *inFunc, int inLine, char *inMessage,...)
void debugCriticalErrorFrom (const char *inFile, const char *inFunc, int inLine, char *inMessage,...)
void debugLogFrom (char *inType, const char *inFile, const char *inFunc, int inLine, char *inMessage,...)
void debugStatusLogFrom (const char *inFile, const char *inFunc, int inLine, char *inMessage,...)
void debugLog (char *inType, char *inMessage,...)
void debugScreenshot ()

Variables

bool debugEnabled
 A boolean value to set whether debugging is disabled at this point or not.


Define Documentation

#define DEBUG_ARGEXTEND   256

The minimum amount to extend a debug message strings length by, in order to make room for the extra arguments that will be inserted into it.

Warning:
This has never been tested with a value < 256.

Definition at line 21 of file flDebug.h.

Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), debugLog(), debugLogFrom(), debugStatusLogFrom(), and debugWarningFrom().

#define debugCriticalError ( inMessage,
...   )     debugCriticalErrorFrom(__FILE__, __FUNCTION__, __LINE__, ## inMessage, __VA_ARGS__)

Definition at line 52 of file flDebug.h.

Referenced by debugCriticalErrorFrom().

#define debugDevWarning ( inMessage,
...   )     debugDevWarningFrom(__FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)

Definition at line 49 of file flDebug.h.

Referenced by debugDevWarningFrom(), fontLoad(), fontSave(), mdl3dAnimLoad(), mdl3dAnimSaveMD2(), mdl3dStatLoad(), mdl3dStatSave(), palCreate(), texMipMapAdd(), vmemAllocBuffer(), and vmemReallocFrom().

#define debugError ( inMessage,
...   )     debugErrorFrom(__FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)

Definition at line 41 of file flDebug.h.

Referenced by callbackCreateThread(), debugErrorFrom(), debugLog(), debugLogFrom(), debugScreenshot(), fileRead(), fileWrite(), fontCreateDebugTex(), fontDraw2dChar(), fontDraw2dString(), graphicsInit(), graphicsRenderToVmem(), graphicsSwizzleData(), graphicsUnswizzleData(), memErrorBytesCheckFrom(), memFreeFrom(), memInit(), memReallocFrom(), memtAddFrom(), memtDelFrom(), memtErrorBytesCheckFrom(), palCreate(), spriteCreate(), texCreate(), texLoad(), texLoadBMP(), texLoadPCX(), texLoadTGA(), texSave(), texSaveTGA(), texScreenshot(), timerCreate(), vmemAllocBuffer(), vmemFreeFrom(), and vmemReallocFrom().

#define debugStatusLog ( inMessage,
...   )     debugStatusLogFrom( __FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)

Definition at line 55 of file flDebug.h.

Referenced by debugScreenshot(), debugStatusLogFrom(), flInitialize(), flTerminate(), memInit(), memTerm(), and ntfyCheckBattery().

#define debugWarning ( inMessage,
...   )     debugWarningFrom(__FILE__, __FUNCTION__, __LINE__, inMessage, ## __VA_ARGS__)

Definition at line 45 of file flDebug.h.

Referenced by camCreate(), debugWarningFrom(), fileCheckState(), fileClose(), fileCopy(), fileDelete(), fileExists(), fileExtension(), fileMkdir(), fileNameFromPath(), fileOpen(), filePuts(), fileSeek(), fileTypeGet(), fontCharWidth(), fontCreateDebug(), fontCreateTexture(), fontDraw2dChar(), fontDraw2dString(), fontFree(), fontHeight(), fontLoad(), graphics2dDrawTexture(), graphicsEffectFsColorEnhance(), graphicsEffectFsDepthFog(), graphicsEffectFsDichrome(), graphicsEffectFsGlow(), graphicsEffectFsGrayscale(), graphicsEffectFsInvert(), graphicsEffectFsLightEnhance(), graphicsEffectFsMonochrome(), graphicsEffectFsNightVision(), graphicsEffectFsThermalVision(), graphicsSwizzleData(), graphicsUnswizzleData(), mdl3dAnimDrawMD2(), mdl3dAnimLoad(), mdl3dAnimLoadMD2(), mdl3dStatDraw(), mdl3dStatFree(), mdl3dStatLoad(), mdl3dStatLoadOBJ(), mdl3dStatLoadOBJ_faceRead(), mdl3dStatOptimize(), mdl3dStatSave(), mdl3dStatSaveOBJ(), memAlignFrom(), memAllocUncachedFrom(), memClearFrom(), memCompareFrom(), memCopyFrom(), memFreeFrom(), mempAlloc(), mempCreate(), mempDestroy(), memReallocFrom(), memSetByteFrom(), memSetShortFrom(), memtErrorBytesCheckFrom(), memUncachedPtrFrom(), ntfyShowBattery(), palBPP(), palClosestColor(), palMoveVMem(), spriteCreate(), spriteFree(), texBind(), texLoad(), texLoadBMP(), texMipMap(), texMipMapAdd(), texMnpColorReplace(), texMoveVMem(), texSave(), texSaveBMP(), texSavePCX(), texSaveTGA(), texSwizzle(), texTreeAdd(), texTreeDelNodeByTex(), texUnswizzle(), timerGetDeltaTime(), vmemAllocFrom(), vmemFragmentation(), vmemInit(), vmemLargestFreeBlock(), vmemReallocFrom(), vmemStrideBlockAdd(), vmemStrideFree(), and vmemTerm().


Function Documentation

void debugCriticalErrorFrom ( const char *  inFile,
const char *  inFunc,
int  inLine,
char *  inMessage,
  ... 
)

Definition at line 270 of file flDebug.c.

References DEBUG_ARGEXTEND, debugCriticalError, debugEnabled, debugLog(), debugLogFrom(), debugScreenshot(), FL_DEBUG_CRITICALERROR_COLOR, flTerminate(), graphicsDispBuffer, graphicsDrawBuffer, graphicsSwapBuffers(), inputLock(), max, and memQalloc.

void debugDevWarningFrom ( const char *  inFile,
const char *  inFunc,
int  inLine,
char *  inMessage,
  ... 
)

Definition at line 194 of file flDebug.c.

References DEBUG_ARGEXTEND, debugDevWarning, debugEnabled, debugLog(), debugLogFrom(), debugScreenshot(), FL_DEBUG_DEVWARNING_COLOR, graphicsDispBuffer, graphicsDrawBuffer, inputLock(), max, memFree, memQalloc, and ntfyTrayAdd().

Referenced by vmemReallocFrom().

void debugErrorFrom ( const char *  inFile,
const char *  inFunc,
int  inLine,
char *  inMessage,
  ... 
)

Definition at line 38 of file flDebug.c.

References DEBUG_ARGEXTEND, debugEnabled, debugError, debugLog(), debugLogFrom(), debugScreenshot(), FL_DEBUG_ERROR_COLOR, flTerminate(), graphicsDispBuffer, graphicsDrawBuffer, inputLock(), max, memFree, memQalloc, and ntfyTrayAdd().

Referenced by memErrorBytesCheckFrom(), memFreeFrom(), memReallocFrom(), memtAddFrom(), memtDelFrom(), memtErrorBytesCheckFrom(), vmemFreeFrom(), and vmemReallocFrom().

void debugInit (  ) 

Definition at line 26 of file flDebug.c.

References fileDelete(), and FL_DEBUG_LOGPATH.

Referenced by flInitialize().

void debugLog ( char *  inType,
char *  inMessage,
  ... 
)

Definition at line 394 of file flDebug.c.

References DEBUG_ARGEXTEND, debugError, FILE_MODE_APPEND, fileClose(), fileOpen(), filePuts(), FL_DEBUG_LOGPATH, max, memFree, and memQalloc.

Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), debugStatusLogFrom(), and debugWarningFrom().

void debugLogFrom ( char *  inType,
const char *  inFile,
const char *  inFunc,
int  inLine,
char *  inMessage,
  ... 
)

Definition at line 346 of file flDebug.c.

References DEBUG_ARGEXTEND, debugError, FILE_MODE_APPEND, fileClose(), fileOpen(), filePuts(), FL_DEBUG_LOGPATH, max, memFree, and memQalloc.

Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), debugStatusLogFrom(), and debugWarningFrom().

void debugScreenshot (  ) 

Definition at line 467 of file flDebug.c.

References debugError, debugStatusLog, FILE_MODE_BINARY, FILE_MODE_READ, fileClose(), fileOpen(), FL_DEBUG_SCREENSHOTPATH, texSave(), and texScreenshot().

Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), and debugWarningFrom().

void debugStatusLogFrom ( const char *  inFile,
const char *  inFunc,
int  inLine,
char *  inMessage,
  ... 
)

Definition at line 440 of file flDebug.c.

References DEBUG_ARGEXTEND, debugLog(), debugLogFrom(), debugStatusLog, FL_DEBUG_STATUS_COLOR, max, memFree, memQalloc, and ntfyTrayAdd().

void debugWarningFrom ( const char *  inFile,
const char *  inFunc,
int  inLine,
char *  inMessage,
  ... 
)

Definition at line 117 of file flDebug.c.

References DEBUG_ARGEXTEND, debugEnabled, debugLog(), debugLogFrom(), debugScreenshot(), debugWarning, FL_DEBUG_WARNING_COLOR, graphicsDispBuffer, graphicsDrawBuffer, inputLock(), max, memFree, memQalloc, and ntfyTrayAdd().

Referenced by memAlignFrom(), memAllocUncachedFrom(), memClearFrom(), memCompareFrom(), memCopyFrom(), memFreeFrom(), memQallocFrom(), memReallocFrom(), memSetByteFrom(), memSetShortFrom(), memtErrorBytesCheckFrom(), memUncachedPtrFrom(), vmemAllocFrom(), and vmemReallocFrom().


Variable Documentation

bool debugEnabled

A boolean value to set whether debugging is disabled at this point or not.

Note:
This is modified internally to stop infinite loops of errors, but it is also possible for the user to use this to stop debugging in certain critical parts of a program.

Definition at line 24 of file flDebug.c.

Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), and debugWarningFrom().


Generated on Wed Sep 5 19:04:02 2007 for funcLib by  doxygen 1.5.1