1 /* 2 * Copyright (c) 2021-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 16 #ifndef OHOS_WM_INCLUDE_WINDOW_MANAGER_HILOG_H 17 #define OHOS_WM_INCLUDE_WINDOW_MANAGER_HILOG_H 18 19 #include "hilog/log.h" 20 namespace OHOS { 21 namespace Rosen { 22 static constexpr unsigned int HILOG_DOMAIN_WINDOW = 0xD004200; 23 static constexpr unsigned int HILOG_DOMAIN_DISPLAY = 0xD004201; 24 static constexpr OHOS::HiviewDFX::HiLogLabel LOG_LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowManager"}; 25 26 #define WLOG_F(...) (void)OHOS::HiviewDFX::HiLog::Fatal(LOG_LABEL, __VA_ARGS__) 27 #define WLOG_E(...) (void)OHOS::HiviewDFX::HiLog::Error(LOG_LABEL, __VA_ARGS__) 28 #define WLOG_W(...) (void)OHOS::HiviewDFX::HiLog::Warn(LOG_LABEL, __VA_ARGS__) 29 #define WLOG_I(...) (void)OHOS::HiviewDFX::HiLog::Info(LOG_LABEL, __VA_ARGS__) 30 #define WLOG_D(...) (void)OHOS::HiviewDFX::HiLog::Debug(LOG_LABEL, __VA_ARGS__) 31 32 #define _W_DFUNC HiviewDFX::HiLog::Debug 33 #define _W_IFUNC HiviewDFX::HiLog::Info 34 #define _W_WFUNC HiviewDFX::HiLog::Warn 35 #define _W_EFUNC HiviewDFX::HiLog::Error 36 37 #define _W_CPRINTF(func, fmt, ...) func(LABEL, "<%{public}d>" fmt, __LINE__, ##__VA_ARGS__) 38 39 #define WLOGD(fmt, ...) _W_CPRINTF(_W_DFUNC, fmt, ##__VA_ARGS__) 40 #define WLOGI(fmt, ...) _W_CPRINTF(_W_IFUNC, fmt, ##__VA_ARGS__) 41 #define WLOGW(fmt, ...) _W_CPRINTF(_W_WFUNC, fmt, ##__VA_ARGS__) 42 #define WLOGE(fmt, ...) _W_CPRINTF(_W_EFUNC, fmt, ##__VA_ARGS__) 43 44 #define _W_FUNC __func__ 45 46 #define WLOGFD(fmt, ...) WLOGD("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) 47 #define WLOGFI(fmt, ...) WLOGI("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) 48 #define WLOGFW(fmt, ...) WLOGW("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) 49 #define WLOGFE(fmt, ...) WLOGE("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) 50 } // namespace OHOS 51 } 52 #endif // FRAMEWORKS_WM_INCLUDE_WINDOW_MANAGER_HILOG_H 53