diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index e7273665fbda1e98e90cf1bb29453129c117fc44..37691a6f08879b438716a5f91f8139bbe1897f76 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -93,7 +93,7 @@ const SensorAgentProxy *SensorAgentProxy::GetSensorsObj() void SensorAgentProxy::HandleSensorData(struct SensorEvent *events, int32_t num, void *data) { if (events == nullptr || num <= 0) { - SENSOR_LOGE("events is null or num is invalid"); + SEN_HILOGE("events is null or num is invalid"); return; } struct SensorEvent eventStream; @@ -101,7 +101,7 @@ void SensorAgentProxy::HandleSensorData(struct SensorEvent *events, int32_t num, eventStream = events[i]; CHKPV(eventStream.data); if (g_subscribeMap.find(eventStream.sensorTypeId) == g_subscribeMap.end()) { - SENSOR_LOGE("sensorTypeId not in g_subscribeMap"); + SEN_HILOGE("sensorTypeId not in g_subscribeMap"); return; } g_subscribeMap[eventStream.sensorTypeId]->callback(&eventStream); @@ -119,7 +119,7 @@ int32_t SensorAgentProxy::CreateSensorDataChannel() const CHKPR(dataChannel_, INVALID_POINTER); auto ret = dataChannel_->CreateSensorDataChannel(HandleSensorData, nullptr); if (ret != ERR_OK) { - SENSOR_LOGE("create data channel failed, ret: %{public}d", ret); + SEN_HILOGE("create data channel failed, ret: %{public}d", ret); return ret; } auto &client = SensorServiceClient::GetInstance(); diff --git a/utils/include/sensor_log.h b/utils/include/sensor_log.h index 716fb658189b8bad8fcf04c98d9636b39765d5cc..aaf115f99fdc9235b7723c97ebab231d758155b0 100755 --- a/utils/include/sensor_log.h +++ b/utils/include/sensor_log.h @@ -30,16 +30,16 @@ constexpr uint32_t SENSOR_LOG_DOMAIN = 0xD002800; #define SENSOR_FUNC_INFO __FUNCTION__, __LINE__ #endif -#define SENSOR_LOGD(fmt, ...) do { \ +#define SEN_HILOGD(fmt, ...) do { \ OHOS::HiviewDFX::HiLog::Debug(LABEL, SENSOR_FUNC_FMT fmt, SENSOR_FUNC_INFO, ##__VA_ARGS__); \ } while (0) -#define SENSOR_LOGI(fmt, ...) do { \ +#define SEN_HILOGI(fmt, ...) do { \ OHOS::HiviewDFX::HiLog::Info(LABEL, SENSOR_FUNC_FMT fmt, SENSOR_FUNC_INFO, ##__VA_ARGS__); \ } while (0) -#define SENSOR_LOGW(fmt, ...) do { \ +#define SEN_HILOGW(fmt, ...) do { \ OHOS::HiviewDFX::HiLog::Warn(LABEL, SENSOR_FUNC_FMT fmt, SENSOR_FUNC_INFO, ##__VA_ARGS__); \ } while (0) -#define SENSOR_LOGE(fmt, ...) do { \ +#define SEN_HILOGE(fmt, ...) do { \ OHOS::HiviewDFX::HiLog::Error(LABEL, SENSOR_FUNC_FMT fmt, SENSOR_FUNC_INFO, ##__VA_ARGS__); \ } while (0) #define SENSOR_LOGF(fmt, ...) do { \ diff --git a/utils/include/sensors_errors.h b/utils/include/sensors_errors.h index 48c713a7976ed7e5f1f3a01114567403ec208fa2..f2de72588ac2e367e095dae4cbc6c063e5501b44 100644 --- a/utils/include/sensors_errors.h +++ b/utils/include/sensors_errors.h @@ -131,7 +131,7 @@ private: #define CHKPL(cond, ...) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPL(%{public}s) is null, do nothing", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPL(%{public}s) is null, do nothing", \ __FILE__, __LINE__, #cond); \ } \ } while (0) @@ -139,7 +139,7 @@ private: #define CHKPV(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPV(%{public}s) is null", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPV(%{public}s) is null", \ __FILE__, __LINE__, #cond); \ return; \ } \ @@ -148,7 +148,7 @@ private: #define CHKPF(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPF(%{public}s) is null", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPF(%{public}s) is null", \ __FILE__, __LINE__, #cond); \ return false; \ } \ @@ -157,7 +157,7 @@ private: #define CHKPC(cond) \ { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPC(%{public}s) is null, skip then continue", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPC(%{public}s) is null, skip then continue", \ __FILE__, __LINE__, #cond); \ continue; \ } \ @@ -166,7 +166,7 @@ private: #define CHKPB(cond) \ { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPC(%{public}s) is null, skip then break", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPC(%{public}s) is null, skip then break", \ __FILE__, __LINE__, #cond); \ break; \ } \ @@ -175,7 +175,7 @@ private: #define CHKPR(cond, r) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPR(%{public}s) is null, return value is %{public}d", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPR(%{public}s) is null, return value is %{public}d", \ __FILE__, __LINE__, #cond, r); \ return r; \ } \ @@ -184,7 +184,7 @@ private: #define CHKPP(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CHKPP(%{public}s) is null, return value is null", \ + SEN_HILOGE("%{public}s, (%{public}d), CHKPP(%{public}s) is null, return value is null", \ __FILE__, __LINE__, #cond); \ return nullptr; \ } \ @@ -193,7 +193,7 @@ private: #define CK(cond, ec) \ do { \ if (!(cond)) { \ - SENSOR_LOGE("%{public}s, (%{public}d), CK(%{public}s), errCode:%{public}d", \ + SEN_HILOGE("%{public}s, (%{public}d), CK(%{public}s), errCode:%{public}d", \ __FILE__, __LINE__, #cond, ec); \ } \ } while (0) @@ -202,14 +202,14 @@ private: #define CHKPL(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPL(%{public}s) is null, do nothing", #cond); \ + SEN_HILOGE("CHKPL(%{public}s) is null, do nothing", #cond); \ } \ } while (0) #define CHKPV(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPV(%{public}s) is null", #cond); \ + SEN_HILOGE("CHKPV(%{public}s) is null", #cond); \ return; \ } \ } while (0) @@ -217,7 +217,7 @@ private: #define CHKPF(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPF(%{public}s) is null", #cond); \ + SEN_HILOGE("CHKPF(%{public}s) is null", #cond); \ return false; \ } \ } while (0) @@ -225,7 +225,7 @@ private: #define CHKPC(cond) \ { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPC(%{public}s) is null, skip then continue", #cond); \ + SEN_HILOGE("CHKPC(%{public}s) is null, skip then continue", #cond); \ continue; \ } \ } @@ -233,7 +233,7 @@ private: #define CHKPB(cond) \ { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPC(%{public}s) is null, skip then break", #cond); \ + SEN_HILOGE("CHKPC(%{public}s) is null, skip then break", #cond); \ break; \ } \ } @@ -241,7 +241,7 @@ private: #define CHKPR(cond, r) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPR(%{public}s) is null, return value is %{public}d", #cond, r); \ + SEN_HILOGE("CHKPR(%{public}s) is null, return value is %{public}d", #cond, r); \ return r; \ } \ } while (0) @@ -249,7 +249,7 @@ private: #define CHKPP(cond) \ do { \ if ((cond) == nullptr) { \ - SENSOR_LOGE("CHKPP(%{public}s) is null, return value is null", #cond); \ + SEN_HILOGE("CHKPP(%{public}s) is null, return value is null", #cond); \ return nullptr; \ } \ } while (0) @@ -257,7 +257,7 @@ private: #define CK(cond, ec) \ do { \ if (!(cond)) { \ - SENSOR_LOGE("CK(%{public}s), errCode:%{public}d", #cond, ec); \ + SEN_HILOGE("CK(%{public}s), errCode:%{public}d", #cond, ec); \ } \ } while (0)