log.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*****************************************************************************
  2. * log.h
  3. *****************************************************************************
  4. * Copyright © 2011-2012 VLC authors and VideoLAN
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  19. *****************************************************************************/
  20. #ifndef LIBVLCJNI_LOG_H
  21. #define LIBVLCJNI_LOG_H
  22. #include <android/log.h>
  23. /* C files should define LOG_TAG before including this header */
  24. #ifndef LOG_TAG
  25. # error You must define LOG_TAG
  26. #endif
  27. #ifndef NDEBUG
  28. # define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
  29. # define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__)
  30. #else
  31. # define LOGD(...) (void)0
  32. # define LOGV(...) (void)0
  33. #endif
  34. #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
  35. #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
  36. #define LOGW(...) __android_log_print(ANDROID_LOG_WARNING,LOG_TAG,__VA_ARGS__)
  37. #endif // LIBVLCJNI_LOG_H