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 16 #ifndef DRAWING_LOG_H 17 #define DRAWING_LOG_H 18 19 #include <chrono> 20 #include <cstdint> 21 #include <functional> 22 #ifdef OHOS_PLATFORM 23 #include <hilog/log.h> 24 #endif 25 26 namespace OHOS { 27 namespace Rosen { 28 29 #ifndef LOGD 30 #ifdef OHOS_PLATFORM 31 32 #undef LOG_DOMAIN 33 #define LOG_DOMAIN 0xD001402 34 35 #undef LOG_TAG 36 #define LOG_TAG "2DGraphics" 37 38 #define LOGD(fmt, ...) \ 39 HILOG_DEBUG(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__) 40 #define LOGI(fmt, ...) \ 41 HILOG_INFO(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__) 42 #define LOGW(fmt, ...) \ 43 HILOG_WARN(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__) 44 #define LOGE(fmt, ...) \ 45 HILOG_ERROR(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__) 46 #else 47 #define LOGD(fmt, ...) 48 #define LOGI(fmt, ...) 49 #define LOGW(fmt, ...) 50 #define LOGE(fmt, ...) 51 #endif 52 #endif 53 } // namespace Rosen 54 } // namespace OHOS 55 #endif 56