18d6344f9Sopenharmony_ci/*
28d6344f9Sopenharmony_ci * Copyright (C) 2022 HiHope Open Source Organization .
38d6344f9Sopenharmony_ci *
48d6344f9Sopenharmony_ci * HDF is dual licensed: you can use it either under the terms of
58d6344f9Sopenharmony_ci * the GPL, or the BSD license, at your option.
68d6344f9Sopenharmony_ci * See the LICENSE file in the root of this repository for complete details.
78d6344f9Sopenharmony_ci */
88d6344f9Sopenharmony_ci
98d6344f9Sopenharmony_ci#ifndef AUDIO_DEVICE_LOG_H
108d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_H
118d6344f9Sopenharmony_ci#include "hdf_log.h"
128d6344f9Sopenharmony_ci
138d6344f9Sopenharmony_ci#ifdef __cplusplus
148d6344f9Sopenharmony_ci#if __cplusplus
158d6344f9Sopenharmony_ciextern "C" {
168d6344f9Sopenharmony_ci#endif
178d6344f9Sopenharmony_ci#endif /* __cplusplus */
188d6344f9Sopenharmony_ci// 1 is on; 0 is off
198d6344f9Sopenharmony_ci#define AUDIO_DEVICE_DEBUG_ON 0
208d6344f9Sopenharmony_ci
218d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_ERR(fmt, arg...) do { \
228d6344f9Sopenharmony_ci    HDF_LOGE("[%s][line:%d]: " fmt, __func__, __LINE__, ##arg); \
238d6344f9Sopenharmony_ci    } while (0)
248d6344f9Sopenharmony_ci
258d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_WARNING(fmt, arg...) do { \
268d6344f9Sopenharmony_ci    HDF_LOGW("[%s][line:%d]: " fmt, __func__, __LINE__, ##arg); \
278d6344f9Sopenharmony_ci    } while (0)
288d6344f9Sopenharmony_ci
298d6344f9Sopenharmony_ci#if (AUDIO_DEVICE_DEBUG_ON)
308d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_INFO(fmt, arg...) do { \
318d6344f9Sopenharmony_ci    HDF_LOGI("[%s][line:%d]: " fmt, __func__, __LINE__, ##arg); \
328d6344f9Sopenharmony_ci    } while (0)
338d6344f9Sopenharmony_ci
348d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_DEBUG(fmt, arg...) do { \
358d6344f9Sopenharmony_ci    HDF_LOGD("[%s][line:%d]: " fmt, __func__, __LINE__, ##arg); \
368d6344f9Sopenharmony_ci    } while (0)
378d6344f9Sopenharmony_ci#else
388d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_INFO(fmt, arg...) do { \
398d6344f9Sopenharmony_ci    } while (0)
408d6344f9Sopenharmony_ci
418d6344f9Sopenharmony_ci#define AUDIO_DEVICE_LOG_DEBUG(fmt, arg...) do { \
428d6344f9Sopenharmony_ci    } while (0)
438d6344f9Sopenharmony_ci#endif
448d6344f9Sopenharmony_ci
458d6344f9Sopenharmony_ci#ifdef __cplusplus
468d6344f9Sopenharmony_ci#if __cplusplus
478d6344f9Sopenharmony_ci}
488d6344f9Sopenharmony_ci#endif
498d6344f9Sopenharmony_ci#endif /* __cplusplus */
508d6344f9Sopenharmony_ci
518d6344f9Sopenharmony_ci#endif /* AUDIO_DEVICE_LOG_H */
52