1 /*
2  * Copyright (c) 2024 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 RENDER_CONTEXT_LOG_H
17 #define RENDER_CONTEXT_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 #undef LOG_DOMAIN
30 #define LOG_DOMAIN 0xD001406
31 
32 #undef LOG_TAG
33 #define LOG_TAG "OHOS::RS"
34 
35 #ifndef LOGD
36 #ifdef OHOS_PLATFORM
37 #define LOGD(fmt, ...)               \
38     HILOG_DEBUG(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
39 #define LOGI(fmt, ...)              \
40     HILOG_INFO(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
41 #define LOGW(fmt, ...)              \
42     HILOG_WARN(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
43 #define LOGE(fmt, ...)               \
44     HILOG_ERROR(LOG_CORE, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
45 #else
46 #define LOGD(fmt, ...)
47 #define LOGI(fmt, ...)
48 #define LOGW(fmt, ...)
49 #define LOGE(fmt, ...)
50 #endif
51 #endif
52 } // namespace Rosen
53 } // namespace OHOS
54 #endif
55