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_C_H 17#define OHOS_UTILS_MEMORY_LIBPURGEABLEMEM_CPP_INCLUDE_PM_LOG_C_H 18 19#include "hilog/log.h" 20 21#undef LOG_DOMAIN 22#undef LOG_TAG 23#define LOG_DOMAIN 0xD001799 24 25#ifdef PM_HILOG_ERROR_C 26#undef PM_HILOG_ERROR_C 27#endif 28 29#ifdef PM_HILOG_INFO_C 30#undef PM_HILOG_INFO_C 31#endif 32 33#ifdef PM_HILOG_DEBUG_C 34#undef PM_HILOG_DEBUG_C 35#endif 36 37#define PM_FILENAME "purgeable" 38 39#define PM_HILOG_ERROR_C(logCore, fmt, ...) \ 40 (void)HILOG_ERROR( \ 41 LOG_CORE, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__) 42 43#define PM_HILOG_INFO_C(logCore, fmt, ...) \ 44 (void)HILOG_INFO( \ 45 LOG_CORE, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__) 46 47#define PM_HILOG_DEBUG_C(logCore, fmt, ...) \ 48 (void)HILOG_DEBUG( \ 49 LOG_CORE, "[%{public}s(%{public}s:%{public}d)]" fmt, PM_FILENAME, __FUNCTION__, __LINE__, ##__VA_ARGS__) 50#endif