Work on basic logging framework.
This commit is contained in:
@ -5,6 +5,33 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
POLYVOXCORE_API extern void (*logImpl)(std::string);
|
||||
//Note: The functions in this file are not for the user to call - they are
|
||||
//intended for internal use only. The only exception is that you may set the
|
||||
//logHandler pointer to point at your own handling funtion for printing, etc.
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
enum LogSeverity
|
||||
{
|
||||
LS_DEBUG,
|
||||
LS_INFO,
|
||||
LS_WARN,
|
||||
LS_ERROR
|
||||
};
|
||||
|
||||
POLYVOXCORE_API extern void (*logHandler)(std::string, int severity);
|
||||
}
|
||||
|
||||
//Debug severity messages are only used if we are a debug build
|
||||
#ifdef _DEBUG
|
||||
#define POLYVOX_LOG_DEBUG(message) if(logHandler){logHandler(message, LS_DEBUG);}
|
||||
#else
|
||||
#define POLYVOX_LOG_DEBUG(message)
|
||||
#endif
|
||||
|
||||
//Other severity levels work in both debug and release
|
||||
#define POLYVOX_LOG_INFO(message) if(logHandler){logHandler(message, LS_INFO);}
|
||||
#define POLYVOX_LOG_WARN(message) if(logHandler){logHandler(message, LS_WARN);}
|
||||
#define POLYVOX_LOG_ERROR(message) if(logHandler){logHandler(message, LS_ERROR);}
|
||||
|
||||
#endif
|
@ -38,7 +38,6 @@ namespace PolyVox
|
||||
Volume<VoxelType>::Volume(uint16_t uSideLength, uint16_t uBlockSideLength)
|
||||
:m_pBlocks(0)
|
||||
{
|
||||
logImpl("In volume constructor");
|
||||
//Debug mode validation
|
||||
assert(isPowerOf2(uSideLength));
|
||||
assert(isPowerOf2(uBlockSideLength));
|
||||
|
@ -1,3 +1,6 @@
|
||||
#include "Log.h"
|
||||
|
||||
void (*logImpl)(std::string) = 0;
|
||||
namespace PolyVox
|
||||
{
|
||||
void (*logHandler)(std::string, int severity) = 0;
|
||||
}
|
Reference in New Issue
Block a user