Log cleanups (#5135)

* Log cleanups

change log levels, shorten log messages, delete commented out logs

* Address comments from review

* Remove full stops

* EDEBUG --> DEBUG
This commit is contained in:
Tom Fifield
2024-11-04 20:09:23 +08:00
committed by GitHub
parent a628c93125
commit 276067065e
34 changed files with 176 additions and 248 deletions

View File

@@ -80,9 +80,9 @@ void BME680Sensor::loadState()
file.read((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE);
file.close();
bme680.setState(bsecState);
LOG_INFO("%s state read from %s.", sensorName, bsecConfigFileName);
LOG_INFO("%s state read from %s", sensorName, bsecConfigFileName);
} else {
LOG_INFO("No %s state found (File: %s).", sensorName, bsecConfigFileName);
LOG_INFO("No %s state found (File: %s)", sensorName, bsecConfigFileName);
}
#else
LOG_ERROR("ERROR: Filesystem not implemented");
@@ -119,12 +119,12 @@ void BME680Sensor::updateState()
}
auto file = FSCom.open(bsecConfigFileName, FILE_O_WRITE);
if (file) {
LOG_INFO("%s state write to %s.", sensorName, bsecConfigFileName);
LOG_INFO("%s state write to %s", sensorName, bsecConfigFileName);
file.write((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE);
file.flush();
file.close();
} else {
LOG_INFO("Can't write %s state (File: %s).", sensorName, bsecConfigFileName);
LOG_INFO("Can't write %s state (File: %s)", sensorName, bsecConfigFileName);
}
}
#else
@@ -145,4 +145,4 @@ void BME680Sensor::checkStatus(String functionName)
LOG_WARN("%s BME68X code: %s", functionName.c_str(), String(bme680.sensor.status).c_str());
}
#endif
#endif

View File

@@ -19,7 +19,7 @@ int32_t MLX90614Sensor::runOnce()
LOG_DEBUG("MLX90614 emissivity: %f", mlx.readEmissivity());
if (fabs(MLX90614_EMISSIVITY - mlx.readEmissivity()) > 0.001) {
mlx.writeEmissivity(MLX90614_EMISSIVITY);
LOG_INFO("MLX90614 emissivity updated. In case of weird data, power cycle.");
LOG_INFO("MLX90614 emissivity updated. In case of weird data, power cycle");
}
LOG_DEBUG("MLX90614 Init Succeed");
status = true;

View File

@@ -103,7 +103,7 @@ bool NAU7802Sensor::saveCalibrationData()
nau7802config.calibrationFactor = nau7802.getCalibrationFactor();
bool okay = false;
LOG_INFO("%s state write to %s.", sensorName, nau7802ConfigFileName);
LOG_INFO("%s state write to %s", sensorName, nau7802ConfigFileName);
pb_ostream_t stream = {&writecb, static_cast<Print *>(&file), meshtastic_Nau7802Config_size};
if (!pb_encode(&stream, &meshtastic_Nau7802Config_msg, &nau7802config)) {
@@ -121,7 +121,7 @@ bool NAU7802Sensor::loadCalibrationData()
auto file = FSCom.open(nau7802ConfigFileName, FILE_O_READ);
bool okay = false;
if (file) {
LOG_INFO("%s state read from %s.", sensorName, nau7802ConfigFileName);
LOG_INFO("%s state read from %s", sensorName, nau7802ConfigFileName);
pb_istream_t stream = {&readcb, &file, meshtastic_Nau7802Config_size};
if (!pb_decode(&stream, &meshtastic_Nau7802Config_msg, &nau7802config)) {
LOG_ERROR("Error: can't decode protobuf %s", PB_GET_ERROR(&stream));
@@ -132,9 +132,9 @@ bool NAU7802Sensor::loadCalibrationData()
}
file.close();
} else {
LOG_INFO("No %s state found (File: %s).", sensorName, nau7802ConfigFileName);
LOG_INFO("No %s state found (File: %s)", sensorName, nau7802ConfigFileName);
}
return okay;
}
#endif
#endif