2016-05-13 23:10:13 +02:00
|
|
|
/** @file
|
|
|
|
* @author Edouard DUPIN
|
|
|
|
* @copyright 2016, Edouard DUPIN, all right reserved
|
2017-01-05 21:28:23 +01:00
|
|
|
* @license MPL v2.0 (see license file)
|
2016-05-13 23:10:13 +02:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-10-02 17:01:22 +02:00
|
|
|
#include <elog/log.hpp>
|
2016-05-13 23:10:13 +02:00
|
|
|
|
|
|
|
namespace appl {
|
|
|
|
int32_t getLogId();
|
|
|
|
};
|
|
|
|
|
|
|
|
#define APPL_BASE(info,data) ELOG_BASE(appl::getLogId(),info,data)
|
|
|
|
|
|
|
|
#define APPL_PRINT(data) APPL_BASE(-1, data)
|
|
|
|
#define APPL_CRITICAL(data) APPL_BASE(1, data)
|
|
|
|
#define APPL_ERROR(data) APPL_BASE(2, data)
|
|
|
|
#define APPL_WARNING(data) APPL_BASE(3, data)
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define APPL_INFO(data) APPL_BASE(4, data)
|
|
|
|
#define APPL_DEBUG(data) APPL_BASE(5, data)
|
|
|
|
#define APPL_VERBOSE(data) APPL_BASE(6, data)
|
|
|
|
#define APPL_TODO(data) APPL_BASE(4, "TODO : " << data)
|
|
|
|
#else
|
|
|
|
#define APPL_INFO(data) do { } while(false)
|
|
|
|
#define APPL_DEBUG(data) do { } while(false)
|
|
|
|
#define APPL_VERBOSE(data) do { } while(false)
|
|
|
|
#define APPL_TODO(data) do { } while(false)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define APPL_ASSERT(cond,data) \
|
|
|
|
do { \
|
|
|
|
if (!(cond)) { \
|
|
|
|
APPL_CRITICAL(data); \
|
|
|
|
assert(!#cond); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|