diff --git a/frameworks/native/src/sensor_agent_proxy.cpp b/frameworks/native/src/sensor_agent_proxy.cpp index d86e4e87b113b0dd69e12844212f3f30a0136350..a3e5a65e455e3b40de4fee24811993c0ff19d372 100644 --- a/frameworks/native/src/sensor_agent_proxy.cpp +++ b/frameworks/native/src/sensor_agent_proxy.cpp @@ -451,7 +451,7 @@ int32_t SensorAgentProxy::ConvertSensorInfos() const sensorInfo->power = sensorList[i].GetPower(); sensorInfo->minSamplePeriod = sensorList[i].GetMinSamplePeriodNs(); sensorInfo->maxSamplePeriod = sensorList[i].GetMaxSamplePeriodNs(); - SEN_HILOGI("deviceId %{public}d: sensorTypeId %{public}d, sensorIndex %{public}d", + SEN_HILOGD("deviceId %{public}d: sensorTypeId %{public}d, sensorIndex %{public}d", sensorInfo->deviceId, sensorInfo->sensorTypeId, sensorInfo->sensorIndex); } sensorInfoCount_ = static_cast(count); diff --git a/utils/common/src/print_sensor_data.cpp b/utils/common/src/print_sensor_data.cpp index c9306c34b0ac49d862c97d5330b45725d1878b53..1280e28961044e21e3a0fe63245020fe03c530bc 100644 --- a/utils/common/src/print_sensor_data.cpp +++ b/utils/common/src/print_sensor_data.cpp @@ -39,7 +39,7 @@ enum { DEFAULT_DIMENSION = 16 }; constexpr int64_t LOG_INTERVAL = 60000000000L; -constexpr int32_t FIRST_PRINT_TIMES = 20; +constexpr int32_t FIRST_PRINT_TIMES = 10; constexpr float LOG_FORMAT_DIVIDER = 1e9f; const std::vector g_triggerSensorType = { @@ -102,11 +102,11 @@ void PrintSensorData::ControlSensorHdiPrint(const SensorData &sensorData) void PrintSensorData::PrintHdiData(const SensorData &sensorData) { std::string str; - str += "deviceId:" + std::to_string(sensorData.deviceId) + ", "; - str += "sensorType:" + std::to_string(sensorData.sensorTypeId) + ", "; - str += "sensorId:" + std::to_string(sensorData.sensorId) + ", "; - str += "location:" + std::to_string(sensorData.location) + ", "; - str += "timestamp:" + std::to_string(sensorData.timestamp / LOG_FORMAT_DIVIDER) + ", "; + str += std::to_string(sensorData.deviceId) + " "; + str += std::to_string(sensorData.sensorTypeId) + " "; + str += std::to_string(sensorData.sensorId) + " "; + str += std::to_string(sensorData.location) + " "; + str += " ts:" + std::to_string(sensorData.timestamp / LOG_FORMAT_DIVIDER) + ", "; int32_t dataDim = GetDataDimension(sensorData.sensorTypeId); auto data = reinterpret_cast(sensorData.data); for (int32_t i = 0; i < dataDim; ++i) { @@ -118,7 +118,7 @@ void PrintSensorData::PrintHdiData(const SensorData &sensorData) ++data; } str.append("\n"); - SEN_HILOGI("SensorData:%{public}s", str.c_str()); + SEN_HILOGI("%{public}s", str.c_str()); } void PrintSensorData::ProcessHdiDFX(const SensorData &sensorData) @@ -213,11 +213,11 @@ void PrintSensorData::ControlSensorClientPrint(const RecordSensorCallback callba void PrintSensorData::PrintClientData(const SensorEvent &event) { std::string str; - str += "deviceId:" + std::to_string(event.deviceId) + ", "; - str += "sensorType:" + std::to_string(event.sensorTypeId) + ", "; - str += "sensorId:" + std::to_string(event.sensorId) + ", "; - str += "location:" + std::to_string(event.location) + ", "; - str += "timestamp:" + std::to_string(event.timestamp / LOG_FORMAT_DIVIDER) + ", "; + str += std::to_string(event.deviceId) + " "; + str += std::to_string(event.sensorTypeId) + " "; + str += std::to_string(event.sensorId) + " "; + str += std::to_string(event.location) + " "; + str += " ts:" + std::to_string(event.timestamp / LOG_FORMAT_DIVIDER) + ", "; int32_t dataDim = GetDataDimension(event.sensorTypeId); auto data = reinterpret_cast(event.data); for (int32_t i = 0; i < dataDim; ++i) { @@ -229,7 +229,7 @@ void PrintSensorData::PrintClientData(const SensorEvent &event) ++data; } str.append("\n"); - SEN_HILOGI("SensorData:%{public}s", str.c_str()); + SEN_HILOGI("%{public}s", str.c_str()); } void PrintSensorData::ProcessClientDFX(const SensorEvent &event) @@ -307,11 +307,11 @@ void PrintSensorData::ResetHdiTimes(int32_t sensorType) void PrintSensorData::PrintSensorDataLog(const std::string &name, const SensorData &data) { std::string str; - str += "deviceId:" + std::to_string(data.deviceId) + ", "; - str += "sensorType:" + std::to_string(data.sensorTypeId) + ", "; - str += "sensorId:" + std::to_string(data.sensorId) + ", "; - str += "location:" + std::to_string(data.location) + ", "; - str += "timestamp:" + std::to_string(data.timestamp / LOG_FORMAT_DIVIDER) + ", "; + str += std::to_string(data.deviceId) + ", "; + str += std::to_string(data.sensorTypeId) + ", "; + str += std::to_string(data.sensorId) + ", "; + str += std::to_string(data.location) + ", "; + str += " ts:" + std::to_string(data.timestamp / LOG_FORMAT_DIVIDER) + ", "; int32_t dataDim = GetDataDimension(data.sensorTypeId); auto tempData = reinterpret_cast(data.data); for (int32_t i = 0; i < dataDim; ++i) { @@ -332,7 +332,7 @@ void PrintSensorData::PrintSensorInfo(SensorInfo *sensorInfos, int32_t sensorInf for (int32_t i = 0; i < sensorInfoCount; ++i) { combineSensorIds = combineSensorIds + std::to_string(sensorInfos[i].sensorTypeId) + " "; } - SEN_HILOGI("PrintSensorInfo success, sensorIds:%{public}s, sensorInfoCount:%{public}d", combineSensorIds.c_str(), + SEN_HILOGD("PrintSensorInfo success, sensorIds:%{public}s, sensorInfoCount:%{public}d", combineSensorIds.c_str(), sensorInfoCount); } } // namespace Sensors