!41 Changed dependency from libhilog to libhilog_base

Merge pull request !41 from karolgrydziuszko/change_dependency_to_hilog_base
This commit is contained in:
openharmony_ci
2021-12-29 04:03:06 +00:00
committed by Gitee
3 changed files with 26 additions and 16 deletions
+2 -2
View File
@@ -110,7 +110,7 @@ ohos_static_library("utilsbase") {
]
public_configs = [ ":static_utils_config" ]
defines = [ "CONFIG_HILOG" ]
external_deps = [ "hilog_native:libhilog" ]
external_deps = [ "hilog_native:libhilog_base" ]
}
ohos_shared_library("utils") {
@@ -123,7 +123,7 @@ ohos_shared_library("utils") {
public_configs = [ ":static_utils_config" ]
subsystem_name = "utils"
defines = [ "CONFIG_HILOG" ]
external_deps = [ "hilog_native:libhilog" ]
external_deps = [ "hilog_native:libhilog_base" ]
part_name = "utils_base"
install_images = [
"system",
+22 -13
View File
@@ -16,13 +16,15 @@
#define UTILS_BASE_LOG_H
#ifdef CONFIG_HILOG
#include "hilog/log.h"
static constexpr OHOS::HiviewDFX::HiLogLabel label = { LOG_CORE, 0xD003D00, "utils_base" };
#define UTILS_LOGF(...) (void)OHOS::HiviewDFX::HiLog::Fatal(label, __VA_ARGS__)
#define UTILS_LOGE(...) (void)OHOS::HiviewDFX::HiLog::Error(label, __VA_ARGS__)
#define UTILS_LOGW(...) (void)OHOS::HiviewDFX::HiLog::Warn(label, __VA_ARGS__)
#define UTILS_LOGI(...) (void)OHOS::HiviewDFX::HiLog::Info(label, __VA_ARGS__)
#define UTILS_LOGD(...) (void)OHOS::HiviewDFX::HiLog::Debug(label, __VA_ARGS__)
#include "hilog_base/log_base.h"
constexpr LogType UTILS_LOG_TYPE = LOG_CORE;
constexpr unsigned int UTILS_LOG_DOMAIN = 0xD003D00;
constexpr const char *UTILS_LOG_TAG = "utils_base";
#define UTILS_LOGF(...) (void)HiLogBasePrint(UTILS_LOG_TYPE, LOG_FATAL, UTILS_LOG_DOMAIN, UTILS_LOG_TAG, __VA_ARGS__)
#define UTILS_LOGE(...) (void)HiLogBasePrint(UTILS_LOG_TYPE, LOG_ERROR, UTILS_LOG_DOMAIN, UTILS_LOG_TAG, __VA_ARGS__)
#define UTILS_LOGW(...) (void)HiLogBasePrint(UTILS_LOG_TYPE, LOG_WARN, UTILS_LOG_DOMAIN, UTILS_LOG_TAG, __VA_ARGS__)
#define UTILS_LOGI(...) (void)HiLogBasePrint(UTILS_LOG_TYPE, LOG_INFO, UTILS_LOG_DOMAIN, UTILS_LOG_TAG, __VA_ARGS__)
#define UTILS_LOGD(...) (void)HiLogBasePrint(UTILS_LOG_TYPE, LOG_DEBUG, UTILS_LOG_DOMAIN, UTILS_LOG_TAG, __VA_ARGS__)
#else
#define UTILS_LOGF(...)
#define UTILS_LOGE(...)
@@ -32,12 +34,19 @@ static constexpr OHOS::HiviewDFX::HiLogLabel label = { LOG_CORE, 0xD003D00, "uti
#endif // CONFIG_HILOG
#if (defined CONFIG_HILOG) && (defined CONFIG_PARCEL_DEBUG)
static constexpr OHOS::HiviewDFX::HiLogLabel parcelLabel = { LOG_CORE, 0xD003D01, "parcel" };
#define PARCEL_LOGF(...) (void)OHOS::HiviewDFX::HiLog::Fatal(parcelLabel, __VA_ARGS__)
#define PARCEL_LOGE(...) (void)OHOS::HiviewDFX::HiLog::Error(parcelLabel, __VA_ARGS__)
#define PARCEL_LOGW(...) (void)OHOS::HiviewDFX::HiLog::Warn(parcelLabel, __VA_ARGS__)
#define PARCEL_LOGI(...) (void)OHOS::HiviewDFX::HiLog::Info(parcelLabel, __VA_ARGS__)
#define PARCEL_LOGD(...) (void)OHOS::HiviewDFX::HiLog::Debug(parcelLabel, __VA_ARGS__)
constexpr LogType PARCEL_LOG_TYPE = LOG_CORE;
constexpr unsigned int PARCEL_LOG_DOMAIN = 0xD003D01;
constexpr const char *PARCEL_LOG_TAG = "parcel";
#define PARCEL_LOGF(...) \
(void)HiLogBasePrint(PARCEL_LOG_TYPE, LOG_FATAL, PARCEL_LOG_DOMAIN, PARCEL_LOG_TAG, __VA_ARGS__)
#define PARCEL_LOGE(...) \
(void)HiLogBasePrint(PARCEL_LOG_TYPE, LOG_ERROR, PARCEL_LOG_DOMAIN, PARCEL_LOG_TAG, __VA_ARGS__)
#define PARCEL_LOGW(...) \
(void)HiLogBasePrint(PARCEL_LOG_TYPE, LOG_WARN, PARCEL_LOG_DOMAIN, PARCEL_LOG_TAG, __VA_ARGS__)
#define PARCEL_LOGI(...) \
(void)HiLogBasePrint(PARCEL_LOG_TYPE, LOG_INFO, PARCEL_LOG_DOMAIN, PARCEL_LOG_TAG, __VA_ARGS__)
#define PARCEL_LOGD(...) \
(void)HiLogBasePrint(PARCEL_LOG_TYPE, LOG_DEBUG, PARCEL_LOG_DOMAIN, PARCEL_LOG_TAG, __VA_ARGS__)
#else
#define PARCEL_LOGF(...)
#define PARCEL_LOGE(...)
+2 -1
View File
@@ -5,7 +5,8 @@
"module_list": [
"//utils/native/base:utils",
"//utils/native/ndk_libraries_config:ndk_libs_config",
"//utils/native/base:utilsecurec_shared"
"//utils/native/base:utilsecurec_shared",
"//third_party/bounds_checking_function:libsec_shared"
],
"inner_kits": [
{