it3256_log.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2021 Huawei Device Co., Ltd.
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #ifndef It3256_LOG_H
  16. #define It3256_LOG_H
  17. #include "hilog/log.h"
  18. #ifndef It3256_LOG_DOMAIN
  19. #define It3256_LOG_DOMAIN 0xD001200
  20. #endif
  21. #ifndef It3256_LOG_TAG
  22. #define It3256_LOG_TAG "It3256"
  23. #endif
  24. #define CUR_FILE_NAME (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
  25. #define It3256_LOGF(fmt, ...) \
  26. ((void)HILOG_IMPL(LOG_CORE, LOG_FATAL, It3256_LOG_DOMAIN, It3256_LOG_TAG, \
  27. "[%{public}s(%{public}s:%{public}d)]" fmt, CUR_FILE_NAME, __FUNCTION__, __LINE__, ##__VA_ARGS__))
  28. #define It3256_LOGE(fmt, ...) \
  29. ((void)HILOG_IMPL(LOG_CORE, LOG_ERROR, It3256_LOG_DOMAIN, It3256_LOG_TAG, \
  30. "[%{public}s(%{public}s:%{public}d)]" fmt, CUR_FILE_NAME, __FUNCTION__, __LINE__, ##__VA_ARGS__))
  31. #define It3256_LOGW(fmt, ...) \
  32. ((void)HILOG_IMPL(LOG_CORE, LOG_WARN, It3256_LOG_DOMAIN, It3256_LOG_TAG, \
  33. "[%{public}s(%{public}s:%{public}d)]" fmt, CUR_FILE_NAME, __FUNCTION__, __LINE__, ##__VA_ARGS__))
  34. #define It3256_LOGI(fmt, ...) \
  35. ((void)HILOG_IMPL(LOG_CORE, LOG_INFO, It3256_LOG_DOMAIN, It3256_LOG_TAG, \
  36. "[%{public}s(%{public}s:%{public}d)]" fmt, CUR_FILE_NAME, __FUNCTION__, __LINE__, ##__VA_ARGS__))
  37. #define It3256_LOGD(fmt, ...) \
  38. ((void)HILOG_IMPL(LOG_CORE, LOG_DEBUG, It3256_LOG_DOMAIN, It3256_LOG_TAG, \
  39. "[%{public}s(%{public}s:%{public}d)]" fmt, CUR_FILE_NAME, __FUNCTION__, __LINE__, ##__VA_ARGS__))
  40. #endif