blob: 43fb0d20cfd6ea601e9a5b677981f980623e0471 [file] [log] [blame]
#ifndef _UTILS_LOG_H_
#define _UTILS_LOG_H_
#include <stdio.h>
#include <string.h>
#include <errno.h>
#if defined(USE_LOGCAT)
#include <include/log.h>
#include "diag_API.h"
#undef LOGD
#undef LOGE
#undef LOGI
#undef LOGV
#undef LOGW
#undef ALOGD
#undef ALOGE
#undef ALOGI
#undef ALOGV
#undef ALOGW
#define LOGD(CAT, format, args...) RLOG_DBG(AUDIO, CAT, format, ##args)
#define LOGE(CAT, format, args...) RLOG_ERROR(AUDIO, CAT, format, ##args)
#define LOGI(CAT, format, args...) RLOG_INFO(AUDIO, CAT, format, ##args)
#define LOGV(CAT, format, args...) RLOG_DBG(AUDIO, CAT, format, ##args)
#define LOGW(CAT, format, args...) RLOG_WARN(AUDIO, CAT, format, ##args)
#define ALOGV LOGV
#define ALOGD LOGD
#define ALOGI LOGI
#define ALOGW LOGW
#define ALOGE LOGE
#elif defined(USE_ACM_LOG)
#include "acm_log.h"
#else
#define LOGV(...) /*nothing*/
#define LOGD(...) /*nothing*/
#define LOGI(...) /*nothing*/
#define LOGW(...) /*nothing*/
#define LOGE(...) /*nothing*/
#define ALOGV LOGV
#define ALOGD LOGD
#define ALOGI LOGI
#define ALOGW LOGW
#define ALOGE LOGE
#endif
/* The snprintf() is not "always" implemented and present in <stdio.h>:
* int snprintf(char *str, size_t size, const char *format, ...);
* Let's re-define it into sprintf()
*/
int snprintf(char *str, size_t size, const char *format, ...);
#endif /*_UTILS_LOG_H_*/