You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.0 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2019-2022. All rights reserved.
* Description: Support hwdisplay hal adaptation interface
* Author: Hisilicon
* Created: 2022-12-28
*/
#ifndef DISPLAY_LOG_H
#define DISPLAY_LOG_H
#include "utils/Log.h" // Linux version also uses log system of Android.
namespace android {
/*
* display log priority values, in ascending priority order.
*/
enum class DISPLAY_LOG_PRIO_E {
DISPLAY_LOG_UNKNOWN = 0,
DISPLAY_LOG_DEFAULT,
DISPLAY_LOG_VERBOSE,
DISPLAY_LOG_DEBUG,
DISPLAY_LOG_INFO,
DISPLAY_LOG_WARN,
DISPLAY_LOG_ERROR,
DISPLAY_LOG_FATAL,
DISPLAY_LOG_BUTT,
};
#ifndef LOG_TAG
#define LOG_TAG NULL
#endif
/*
* Simplified macro to send a verbose log message using the current LOG_TAG.
*/
#ifndef LOGV
#if LOG_NDEBUG
#define LOGV(...) ((void)0)
#else
#define LOGV(...) ((void)LOG(DISPLAY_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
#endif
#endif
/*
* Simplified macro to send a debug log message using the current LOG_TAG.
*/
#ifndef LOGD
#if LOG_NDEBUG
#define LOGD(...) ((void)0)
#else
#define LOGD(...) ((void)LOG(DISPLAY_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
#endif
#endif
/*
* Simplified macro to send an info log message using the current LOG_TAG.
*/
#ifndef LOGI
#if LOG_NDEBUG
#define LOGI(...) ((void)0)
#else
#define LOGI(...) ((void)LOG(DISPLAY_LOG_INFO, LOG_TAG, __VA_ARGS__))
#endif
#endif
/*
* Simplified macro to send a warning log message using the current LOG_TAG.
*/
#ifndef LOGW
#if LOG_NDEBUG
#define LOGW(...) ((void)0)
#else
#define LOGW(...) ((void)LOG(DISPLAY_LOG_WARN, LOG_TAG, __VA_ARGS__))
#endif
#endif
/*
* Simplified macro to send an error log message using the current LOG_TAG.
*/
#ifndef LOGE
#if LOG_NDEBUG
#define LOGE(...) ((void)0)
#else
#define LOGE(...) ((void)LOG(DISPLAY_LOG_ERROR, LOG_TAG, __VA_ARGS__))
#endif
#endif
/*
* Simplified macro to send an error log message using the current LOG_TAG.
*/
#ifndef LOGF
#if LOG_NDEBUG
#define LOGF(...) ((void)0)
#else
#define LOGF(...) ((void)LOG(DISPLAY_LOG_FATAL, LOG_TAG, __VA_ARGS__))
#endif
#endif
}
#endif