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#undef LOG_TAG 22#define LOG_TAG "MemMgrPurge" 23 24#undef LOG_DOMAIN 25#define LOG_DOMAIN 0xD001799 26 27#ifdef PM_HILOG_ERROR 28#undef PM_HILOG_ERROR 29#endif 30 31#ifdef PM_HILOG_INFO 32#undef PM_HILOG_INFO 33#endif 34 35#ifdef PM_HILOG_DEBUG 36#undef PM_HILOG_DEBUG 37#endif 38 39#define PM_FILENAME "purgeable" 40 41#define PM_HILOG_ERROR(logCore, fmt, ...) \ 42 HILOG_ERROR( \ 43 LOG_CORE, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__) 44 45#define PM_HILOG_INFO(logCore, fmt, ...) \ 46 HILOG_INFO( \ 47 LOG_CORE, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__) 48 49#define PM_HILOG_DEBUG(logCore, fmt, ...) \ 50 HILOG_DEBUG( \ 51 LOG_CORE, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__) 52#endif