41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
#pragma once
|
|
|
|
|
|
#if defined(_WIN32) && defined (HISLOG_EXPORTS)
|
|
#define HISLOG_API __declspec(dllexport)
|
|
#else
|
|
#define HISLOG_API extern
|
|
#endif
|
|
|
|
|
|
|
|
extern "C"
|
|
HISLOG_API void hislog(
|
|
unsigned int level,
|
|
const char* tag,
|
|
const char* func,
|
|
const char* fmt,
|
|
...
|
|
);
|
|
|
|
|
|
|
|
#define FUNC_HISLOG(level, tag, fmt, ...) \
|
|
do { \
|
|
hislog(level, tag, __FUNCTION__, "%s() " fmt, __FUNCTION__, ##__VA_ARGS__); \
|
|
} while(false);
|
|
|
|
|
|
#define LOGV(fmt, ...) hislog(0, LOG_TAG, __FUNCTION__, fmt, ##__VA_ARGS__)
|
|
#define LOGD(fmt, ...) hislog(1, LOG_TAG, __FUNCTION__, fmt, ##__VA_ARGS__)
|
|
#define LOGI(fmt, ...) hislog(2, LOG_TAG, __FUNCTION__, fmt, ##__VA_ARGS__)
|
|
#define LOGW(fmt, ...) hislog(3, LOG_TAG, __FUNCTION__, fmt, ##__VA_ARGS__)
|
|
#define LOGE(fmt, ...) hislog(4, LOG_TAG, __FUNCTION__, fmt, ##__VA_ARGS__)
|
|
|
|
#define FUNC_LOGV(fmt, ...) FUNC_HISLOG(0, LOG_TAG, fmt, ##__VA_ARGS__)
|
|
#define FUNC_LOGD(fmt, ...) FUNC_HISLOG(1, LOG_TAG, fmt, ##__VA_ARGS__)
|
|
#define FUNC_LOGI(fmt, ...) FUNC_HISLOG(2, LOG_TAG, fmt, ##__VA_ARGS__)
|
|
#define FUNC_LOGW(fmt, ...) FUNC_HISLOG(3, LOG_TAG, fmt, ##__VA_ARGS__)
|
|
#define FUNC_LOGE(fmt, ...) FUNC_HISLOG(4, LOG_TAG, fmt, ##__VA_ARGS__)
|
|
|