1 /* 2 * Copyright (c) 2022 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 FRAMEWORKS_OPENGL_WRAPPER_WRAPPER_LOG_H 16 #define FRAMEWORKS_OPENGL_WRAPPER_WRAPPER_LOG_H 17 18 #include <hilog/log.h> 19 namespace OHOS { 20 #ifdef __aarch64__ 21 #define WPUBI64 "%{public}ld" 22 #define WPUBSize "%{public}lu" 23 #define WPUBU64 "%{public}lu" 24 #else 25 #define WPUBI64 "%{public}lld" 26 #define WPUBSize "%{public}u" 27 #define WPUBU64 "%{public}llu" 28 #endif 29 30 #define GLW_DFUNC OHOS::HiviewDFX::HiLog::Debug 31 #define GLW_IFUNC OHOS::HiviewDFX::HiLog::Info 32 #define GLW_WFUNC OHOS::HiviewDFX::HiLog::Warn 33 #define GLW_EFUNC OHOS::HiviewDFX::HiLog::Error 34 35 #define GLW_CPRINTF(func, fmt, ...) \ 36 func( {LOG_CORE, 0xD001400, "OpenGLWrapper"}, "<%{public}d>%{public}s: " fmt, \ 37 __LINE__, __func__, ##__VA_ARGS__) 38 39 #ifdef EGL_WRAPPER_DEBUG_ENABLE 40 #define WLOGD(fmt, ...) GLW_CPRINTF(GLW_DFUNC, fmt, ##__VA_ARGS__) 41 #else 42 #define WLOGD(fmt, ...) 43 #endif 44 45 #define WLOGI(fmt, ...) GLW_CPRINTF(GLW_IFUNC, fmt, ##__VA_ARGS__) 46 #define WLOGW(fmt, ...) GLW_CPRINTF(GLW_WFUNC, fmt, ##__VA_ARGS__) 47 #define WLOGE(fmt, ...) GLW_CPRINTF(GLW_EFUNC, fmt, ##__VA_ARGS__) 48 } // namespace OHOS 49 #endif // FRAMEWORKS_OPENGL_WRAPPER_WRAPPER_LOG_H 50