50 lines
1.7 KiB
C
50 lines
1.7 KiB
C
/*
|
|
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef NATIVE_XCOMPONENT_COMMON_H
|
|
#define NATIVE_XCOMPONENT_COMMON_H
|
|
|
|
#include <EGL/egl.h>
|
|
#include <EGL/eglext.h>
|
|
#include <EGL/eglplatform.h>
|
|
#include <GLES3/gl3.h>
|
|
#include <napi/native_api.h>
|
|
#include "hilog/log.h"
|
|
#include <thread>
|
|
#include <exception>
|
|
/**
|
|
LOG_APP 日志级别
|
|
LOG_ERROR 错误级别
|
|
DOMAIN 日志域
|
|
TAG 标签
|
|
##__VA_ARGS__ 消息(可为空)
|
|
*/
|
|
#define DOMAIN 0xD001000
|
|
#define LOG_TYPE 0
|
|
const unsigned int LOG_PRINT_DOMAIN = 0xFF00;
|
|
#if LOG_TYPE == 0
|
|
#define HILOG_DEBUG(TAG, fmt, ...) OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_PRINT_DOMAIN, TAG, fmt, ##__VA_ARGS__)
|
|
#define HILOG_INFO(TAG, fmt, ...) OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN, TAG, fmt, ##__VA_ARGS__)
|
|
#define HILOG_WARN(TAG, fmt, ...) OH_LOG_Print(LOG_APP, LOG_WARN, LOG_PRINT_DOMAIN, TAG, fmt, ##__VA_ARGS__)
|
|
#define HILOG_ERROR(TAG, fmt, ...) OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, TAG, fmt, ##__VA_ARGS__)
|
|
#elif LOG_TYPE == 1
|
|
#define HILOG_DEBUG(TAG, fmt, ...)
|
|
#define HILOG_INFO(TAG, fmt, ...)
|
|
#define HILOG_WARN(TAG, fmt, ...)
|
|
#define HILOG_ERROR(TAG, fmt, ...)
|
|
#endif
|
|
|
|
#endif // NATIVE_XCOMPONENT_COMMON_H
|