• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #define LOGD(fmt, ...)               \
32     ::OHOS::HiviewDFX::HiLog::Debug(::OHOS::HiviewDFX::HiLogLabel \
33         { LOG_CORE, 0xD001402, "2DGraphics" }, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
34 #define LOGI(fmt, ...)              \
35     ::OHOS::HiviewDFX::HiLog::Info(::OHOS::HiviewDFX::HiLogLabel \
36         { LOG_CORE, 0xD001402, "2DGraphics" }, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
37 #define LOGW(fmt, ...)              \
38     ::OHOS::HiviewDFX::HiLog::Warn(::OHOS::HiviewDFX::HiLogLabel \
39         { LOG_CORE, 0xD001402, "2DGraphics" }, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
40 #define LOGE(fmt, ...)               \
41     ::OHOS::HiviewDFX::HiLog::Error(::OHOS::HiviewDFX::HiLogLabel \
42         { LOG_CORE, 0xD001402, "2DGraphics" }, "%{public}s: " fmt, __func__, ##__VA_ARGS__)
43 #else
44 #define LOGD(fmt, ...)
45 #define LOGI(fmt, ...)
46 #define LOGW(fmt, ...)
47 #define LOGE(fmt, ...)
48 #endif
49 #endif
50 } // namespace Rosen
51 } // namespace OHOS
52 #endif
53