audiolog.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef __AUDIOLOG_H__
  2. #define __AUDIOLOG_H__
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define AUDIO_LOG_LEVEL_NONE 0
  8. #define AUDIO_LOG_LEVEL_INFO 1
  9. #define AUDOI_LOG_LEVEL_TRACE 2
  10. #define AUDIO_LOG_LEVEL_DEBUG 3
  11. #define AUDIO_LOG_LEVEL_WARN 4
  12. #define AUDIO_LOG_LEVEL_ERROR 5
  13. #define AUDIO_LOG_LEVEL_ALL 10
  14. #ifdef _WIN32
  15. typedef void(__stdcall* audio_log_func)(int level, const char* s);
  16. #else
  17. typedef void(__attribute__((__stdcall))* audio_log_func)(int level, const char* s);
  18. #endif
  19. void audio_log_set_level(int level);
  20. audio_log_func audio_log_set_func(audio_log_func func);
  21. void audio_log(int level, const char *str);
  22. void audio_log_v(int level, const char *fmt, ...);
  23. //#define AUDIO_LOG_DEBUG(fmt, ...) \
  24. // audio_log_v(AUDIO_LOG_LEVEL_DEBUG, fmt, __VA_ARGS__ )
  25. //
  26. //#define AUDIO_LOG_INFO(fmt, ...) \
  27. // audio_log_v(AUDIO_LOG_LEVEL_INFO, fmt, __VA_ARGS__ )
  28. //
  29. //#define AUDIO_LOG_TRACE(fmt, ...) \
  30. // audio_log_v(AUDOI_LOG_LEVEL_TRACE, fmt, __VA_ARGS__ )
  31. //
  32. //#define AUDIO_LOG_WARN(fmt, ...) \
  33. // audio_log_v(AUDIO_LOG_LEVEL_WARN, fmt, __VA_ARGS__ )
  34. //
  35. //#define audio_log_v(AUDIO_LOG_LEVEL_ERROR,fmt, ...) \
  36. // audio_log_v(AUDIO_LOG_LEVEL_ERROR, fmt, __VA_ARGS__ )
  37. #ifdef __cplusplus
  38. } // extern "C" {
  39. #endif
  40. #endif //__AUDIOLOG_H__