18d05d8e7Sopenharmony_ci/* 28d05d8e7Sopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 38d05d8e7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48d05d8e7Sopenharmony_ci * you may not use this file except in compliance with the License. 58d05d8e7Sopenharmony_ci * You may obtain a copy of the License at 68d05d8e7Sopenharmony_ci * 78d05d8e7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88d05d8e7Sopenharmony_ci * 98d05d8e7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108d05d8e7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118d05d8e7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128d05d8e7Sopenharmony_ci * See the License for the specific language governing permissions and 138d05d8e7Sopenharmony_ci * limitations under the License. 148d05d8e7Sopenharmony_ci */ 158d05d8e7Sopenharmony_ci 168d05d8e7Sopenharmony_ci#ifndef HILOG_WRAPPER_H 178d05d8e7Sopenharmony_ci#define HILOG_WRAPPER_H 188d05d8e7Sopenharmony_ci 198d05d8e7Sopenharmony_ci#define CONFIG_HILOG 208d05d8e7Sopenharmony_ci#ifdef CONFIG_HILOG 218d05d8e7Sopenharmony_ci#include "hilog/log.h" 228d05d8e7Sopenharmony_ci 238d05d8e7Sopenharmony_ci#ifdef HILOG_FATAL 248d05d8e7Sopenharmony_ci#undef HILOG_FATAL 258d05d8e7Sopenharmony_ci#endif 268d05d8e7Sopenharmony_ci 278d05d8e7Sopenharmony_ci#ifdef HILOG_ERROR 288d05d8e7Sopenharmony_ci#undef HILOG_ERROR 298d05d8e7Sopenharmony_ci#endif 308d05d8e7Sopenharmony_ci 318d05d8e7Sopenharmony_ci#ifdef HILOG_WARN 328d05d8e7Sopenharmony_ci#undef HILOG_WARN 338d05d8e7Sopenharmony_ci#endif 348d05d8e7Sopenharmony_ci 358d05d8e7Sopenharmony_ci#ifdef HILOG_INFO 368d05d8e7Sopenharmony_ci#undef HILOG_INFO 378d05d8e7Sopenharmony_ci#endif 388d05d8e7Sopenharmony_ci 398d05d8e7Sopenharmony_ci#ifdef HILOG_DEBUG 408d05d8e7Sopenharmony_ci#undef HILOG_DEBUG 418d05d8e7Sopenharmony_ci#endif 428d05d8e7Sopenharmony_ci 438d05d8e7Sopenharmony_ci#ifndef FAF_LOG_DOMAIN 448d05d8e7Sopenharmony_ci#define FAF_LOG_DOMAIN 0xD00430A 458d05d8e7Sopenharmony_ci#endif 468d05d8e7Sopenharmony_ci 478d05d8e7Sopenharmony_ci#ifndef FAF_LOG_TAG 488d05d8e7Sopenharmony_ci#define FAF_LOG_TAG "FileAccessFwk" 498d05d8e7Sopenharmony_ci#endif 508d05d8e7Sopenharmony_ci 518d05d8e7Sopenharmony_ci#define HILOG_FATAL(fmt, ...) \ 528d05d8e7Sopenharmony_ci ((void)HILOG_IMPL(LOG_CORE, LOG_FATAL, FAF_LOG_DOMAIN, FAF_LOG_TAG, \ 538d05d8e7Sopenharmony_ci "[(%{public}s:%{public}d)]" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)) 548d05d8e7Sopenharmony_ci#define HILOG_ERROR(fmt, ...) \ 558d05d8e7Sopenharmony_ci ((void)HILOG_IMPL(LOG_CORE, LOG_ERROR, FAF_LOG_DOMAIN, FAF_LOG_TAG, \ 568d05d8e7Sopenharmony_ci "[(%{public}s:%{public}d)]" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)) 578d05d8e7Sopenharmony_ci#define HILOG_WARN(fmt, ...) \ 588d05d8e7Sopenharmony_ci ((void)HILOG_IMPL(LOG_CORE, LOG_WARN, FAF_LOG_DOMAIN, FAF_LOG_TAG, \ 598d05d8e7Sopenharmony_ci "[(%{public}s:%{public}d)]" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)) 608d05d8e7Sopenharmony_ci#define HILOG_INFO(fmt, ...) \ 618d05d8e7Sopenharmony_ci ((void)HILOG_IMPL(LOG_CORE, LOG_INFO, FAF_LOG_DOMAIN, FAF_LOG_TAG, \ 628d05d8e7Sopenharmony_ci "[(%{public}s:%{public}d)]" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)) 638d05d8e7Sopenharmony_ci#define HILOG_DEBUG(fmt, ...) \ 648d05d8e7Sopenharmony_ci ((void)HILOG_IMPL(LOG_CORE, LOG_DEBUG, FAF_LOG_DOMAIN, FAF_LOG_TAG, \ 658d05d8e7Sopenharmony_ci "[(%{public}s:%{public}d)]" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)) 668d05d8e7Sopenharmony_ci#else 678d05d8e7Sopenharmony_ci 688d05d8e7Sopenharmony_ci#define HILOG_FATAL(...) 698d05d8e7Sopenharmony_ci#define HILOG_ERROR(...) 708d05d8e7Sopenharmony_ci#define HILOG_WARN(...) 718d05d8e7Sopenharmony_ci#define HILOG_INFO(...) 728d05d8e7Sopenharmony_ci#define HILOG_DEBUG(...) 738d05d8e7Sopenharmony_ci#endif // CONFIG_HILOG 748d05d8e7Sopenharmony_ci 758d05d8e7Sopenharmony_ci#endif // HILOG_WRAPPER_H