• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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_UTILS_MEMORY_LIBPURGEABLEMEM_CPP_INCLUDE_PM_LOG_H
17 #define OHOS_UTILS_MEMORY_LIBPURGEABLEMEM_CPP_INCLUDE_PM_LOG_H
18 
19 #include "hilog/log.h"
20 
21 static constexpr OHOS::HiviewDFX::HiLogLabel PM_LOG_LABEL = { LOG_CORE, 0xD001799, "MemMgrPurge" };
22 
23 #ifdef PM_HILOG_ERROR
24 #undef PM_HILOG_ERROR
25 #endif
26 
27 #ifdef PM_HILOG_INFO
28 #undef PM_HILOG_INFO
29 #endif
30 
31 #ifdef PM_HILOG_DEBUG
32 #undef PM_HILOG_DEBUG
33 #endif
34 
35 #define PM_FILENAME "purgeable"
36 
37 #define PM_HILOG_ERROR(logCore, fmt, ...)            \
38     (void)OHOS::HiviewDFX::HiLog::Error(             \
39         PM_LOG_LABEL, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__)
40 
41 #define PM_HILOG_INFO(logCore, fmt, ...)             \
42     (void)OHOS::HiviewDFX::HiLog::Info(              \
43         PM_LOG_LABEL, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__)
44 
45 #define PM_HILOG_DEBUG(logCore, fmt, ...)            \
46     (void)OHOS::HiviewDFX::HiLog::Debug(             \
47         PM_LOG_LABEL, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__)
48 #endif