1570af302Sopenharmony_ci/* 2570af302Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 3570af302Sopenharmony_ci * 4570af302Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy 5570af302Sopenharmony_ci * of this software and associated documentation files (the "Software"), to 6570af302Sopenharmony_ci * deal in the Software without restriction, including without limitation the 7570af302Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8570af302Sopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is 9570af302Sopenharmony_ci * furnished to do so, subject to the following conditions: 10570af302Sopenharmony_ci * 11570af302Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 12570af302Sopenharmony_ci * all copies or substantial portions of the Software. 13570af302Sopenharmony_ci * 14570af302Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15570af302Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16570af302Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17570af302Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18570af302Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19570af302Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20570af302Sopenharmony_ci * IN THE SOFTWARE. 21570af302Sopenharmony_ci */ 22570af302Sopenharmony_ci 23570af302Sopenharmony_ci#ifndef _MUSL_LOG_H 24570af302Sopenharmony_ci#define _MUSL_LOG_H 25570af302Sopenharmony_ci 26570af302Sopenharmony_ci#include <hilog_adapter.h> 27570af302Sopenharmony_ci 28570af302Sopenharmony_ci#ifdef __cplusplus 29570af302Sopenharmony_ciextern "C" { 30570af302Sopenharmony_ci#endif 31570af302Sopenharmony_ci 32570af302Sopenharmony_ci#define MUSL_LOG_TYPE LOG_CORE 33570af302Sopenharmony_ci#define MUSL_LOG_DOMAIN 0xD003F00 34570af302Sopenharmony_ci#define MUSL_LOG_TAG "MUSL" 35570af302Sopenharmony_ci 36570af302Sopenharmony_ci#if (defined(OHOS_ENABLE_PARAMETER) || defined(ENABLE_MUSL_LOG)) 37570af302Sopenharmony_ci#define MUSL_LOGE(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_ERROR, MUSL_LOG_DOMAIN, MUSL_LOG_TAG, __VA_ARGS__)) 38570af302Sopenharmony_ci#define MUSL_LOGW(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_WARN, MUSL_LOG_DOMAIN, MUSL_LOG_TAG, __VA_ARGS__)) 39570af302Sopenharmony_ci#define MUSL_LOGI(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_INFO, MUSL_LOG_DOMAIN, MUSL_LOG_TAG, __VA_ARGS__)) 40570af302Sopenharmony_ci#define MUSL_LOGD(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_DEBUG, MUSL_LOG_DOMAIN, MUSL_LOG_TAG, __VA_ARGS__)) 41570af302Sopenharmony_ci 42570af302Sopenharmony_ci#else 43570af302Sopenharmony_ci#define MUSL_LOGE(...) 44570af302Sopenharmony_ci#define MUSL_LOGW(...) 45570af302Sopenharmony_ci#define MUSL_LOGI(...) 46570af302Sopenharmony_ci#define MUSL_LOGD(...) 47570af302Sopenharmony_ci#endif 48570af302Sopenharmony_ci 49570af302Sopenharmony_ci#ifdef __cplusplus 50570af302Sopenharmony_ci} 51570af302Sopenharmony_ci#endif 52570af302Sopenharmony_ci#endif 53