LibCT 2.0

Include/Debug.h

Go to the documentation of this file.
00001 // ------------------------------------------------------------------
00012 #ifndef _LIBCT_DEBUG_H
00013 #define _LIBCT_DEBUG_H
00014 
00015 #include "Logger.h"
00016 #include "Exception.h"
00017 #include <assert.h>
00018 
00019 #if (!defined(NDEBUG))
00020 # define LIBCTASSERT(x) LIBCTERROR("ASSERT FAILED:"#x); assert(x)
00021 # else
00022 # define LIBCTASSERT(x) LIBCTERROR("ASSERT FAILED:"#x)
00023 #endif //(!defined(NDEBUG))
00024 
00026 # define LIBCTERROR(exp)        LibCT::Logger::Instance()->Log(LogLevelCritical, exp)
00027 
00028 # define LIBCTWARNING(exp)      LibCT::Logger::Instance()->Log(LogLevelWarning, exp)
00029 
00030 # define LIBCTMESSAGE(exp)      LibCT::Logger::Instance()->Log(LogLevelPedantic, exp)
00031 
00033 # define LIBCTEXCEPTION(num, desc, src) throw LibCT::ExceptionFactory::Create( \
00034         LibCT::ExceptionCodeType<num>(), desc, src, __FILE__, __LINE__ );
00035 
00036 #endif // _LIBCT_DEBUG_H