hal-log.h 652 B

123456789101112131415161718192021222324
  1. /* SPDX-License-Identifier: Apache-2.0 */
  2. /*
  3. * Copyright (C) 2013 Intel Corporation
  4. *
  5. */
  6. #define LOG_TAG "BlueZ"
  7. #ifdef __BIONIC__
  8. #include <cutils/log.h>
  9. #else
  10. #include <stdio.h>
  11. #define LOG_INFO " I"
  12. #define LOG_WARN " W"
  13. #define LOG_ERROR " E"
  14. #define LOG_DEBUG " D"
  15. #define ALOG(pri, tag, fmt, arg...) fprintf(stderr, tag pri": " fmt"\n", ##arg)
  16. #endif
  17. #define info(fmt, arg...) ALOG(LOG_INFO, LOG_TAG, fmt, ##arg)
  18. #define warn(fmt, arg...) ALOG(LOG_WARN, LOG_TAG, fmt, ##arg)
  19. #define error(fmt, arg...) ALOG(LOG_ERROR, LOG_TAG, fmt, ##arg)
  20. #define DBG(fmt, arg...) ALOG(LOG_DEBUG, LOG_TAG, "%s:%s() "fmt, __FILE__, \
  21. __func__, ##arg)