More log reductions. I'll probably stop now ;-) (#5263)
Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run

This commit is contained in:
Ben Meadors 2024-11-06 07:03:25 -06:00 committed by GitHub
parent 8498b175e7
commit 982190936d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 35 additions and 36 deletions

View File

@ -329,7 +329,7 @@ void fsInit()
{ {
#ifdef FSCom #ifdef FSCom
if (!FSBegin()) { if (!FSBegin()) {
LOG_ERROR("Filesystem mount Failed."); LOG_ERROR("Filesystem mount failed");
// assert(0); This auto-formats the partition, so no need to fail here. // assert(0); This auto-formats the partition, so no need to fail here.
} }
#if defined(ARCH_ESP32) #if defined(ARCH_ESP32)

View File

@ -13,17 +13,17 @@ void AirTime::logAirtime(reportTypes reportType, uint32_t airtime_ms)
{ {
if (reportType == TX_LOG) { if (reportType == TX_LOG) {
LOG_DEBUG("Packet transmitted : %ums", airtime_ms); LOG_DEBUG("Packet TX: %ums", airtime_ms);
this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms; this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms;
air_period_tx[0] = air_period_tx[0] + airtime_ms; air_period_tx[0] = air_period_tx[0] + airtime_ms;
this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms; this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms;
} else if (reportType == RX_LOG) { } else if (reportType == RX_LOG) {
LOG_DEBUG("Packet received : %ums", airtime_ms); LOG_DEBUG("Packet RX: %ums", airtime_ms);
this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms; this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms;
air_period_rx[0] = air_period_rx[0] + airtime_ms; air_period_rx[0] = air_period_rx[0] + airtime_ms;
} else if (reportType == RX_ALL_LOG) { } else if (reportType == RX_ALL_LOG) {
LOG_DEBUG("Packet received (noise?) : %ums", airtime_ms); LOG_DEBUG("Packet RX (noise?) : %ums", airtime_ms);
this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms; this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms;
} }
@ -126,7 +126,7 @@ bool AirTime::isTxAllowedChannelUtil(bool polite)
if (channelUtilizationPercent() < percentage) { if (channelUtilizationPercent() < percentage) {
return true; return true;
} else { } else {
LOG_WARN("Channel utilization is >%d percent. Skip opportunity to send.", percentage); LOG_WARN("Ch. util >%d%%. Skip send", percentage);
return false; return false;
} }
} }
@ -137,8 +137,7 @@ bool AirTime::isTxAllowedAirUtil()
if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) { if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) {
return true; return true;
} else { } else {
LOG_WARN("Tx air utilization is >%f percent. Skip opportunity to send.", LOG_WARN("TX air util. >%f%%. Skip send", myRegion->dutyCycle * polite_duty_cycle_percent / 100);
myRegion->dutyCycle * polite_duty_cycle_percent / 100);
return false; return false;
} }
} }

View File

@ -170,7 +170,7 @@ bool EInkDynamicDisplay::determineMode()
checkFastRequested(); checkFastRequested();
if (refresh == UNSPECIFIED) if (refresh == UNSPECIFIED)
LOG_WARN("There was a flaw in the determineMode() logic."); LOG_WARN("There was a flaw in the determineMode() logic");
// -- Decision has been reached -- // -- Decision has been reached --
applyRefreshMode(); applyRefreshMode();

View File

@ -1789,7 +1789,7 @@ int32_t Screen::runOnce()
// serialSinceMsec adjusts for additional serial wait time during nRF52 bootup // serialSinceMsec adjusts for additional serial wait time during nRF52 bootup
static bool showingBootScreen = true; static bool showingBootScreen = true;
if (showingBootScreen && (millis() > (logo_timeout + serialSinceMsec))) { if (showingBootScreen && (millis() > (logo_timeout + serialSinceMsec))) {
LOG_INFO("Done with boot screen..."); LOG_INFO("Done with boot screen");
stopBootScreen(); stopBootScreen();
showingBootScreen = false; showingBootScreen = false;
} }

View File

@ -116,7 +116,7 @@ void MPR121Keyboard::begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr)
void MPR121Keyboard::reset() void MPR121Keyboard::reset()
{ {
LOG_DEBUG("MPR121 Reset..."); LOG_DEBUG("MPR121 Reset");
// Trigger a MPR121 Soft Reset // Trigger a MPR121 Soft Reset
if (m_wire) { if (m_wire) {
m_wire->beginTransmission(m_addr); m_wire->beginTransmission(m_addr);

View File

@ -435,7 +435,7 @@ void setup()
// accessories // accessories
auto i2cScanner = std::unique_ptr<ScanI2CTwoWire>(new ScanI2CTwoWire()); auto i2cScanner = std::unique_ptr<ScanI2CTwoWire>(new ScanI2CTwoWire());
#if HAS_WIRE #if HAS_WIRE
LOG_INFO("Scan for i2c devices..."); LOG_INFO("Scan for i2c devices");
#endif #endif
#if defined(I2C_SDA1) && defined(ARCH_RP2040) #if defined(I2C_SDA1) && defined(ARCH_RP2040)
@ -460,7 +460,7 @@ void setup()
i2cScanner->scanPort(ScanI2C::I2CPort::WIRE); i2cScanner->scanPort(ScanI2C::I2CPort::WIRE);
#elif defined(ARCH_PORTDUINO) #elif defined(ARCH_PORTDUINO)
if (settingsStrings[i2cdev] != "") { if (settingsStrings[i2cdev] != "") {
LOG_INFO("Scan for i2c devices..."); LOG_INFO("Scan for i2c devices");
i2cScanner->scanPort(ScanI2C::I2CPort::WIRE); i2cScanner->scanPort(ScanI2C::I2CPort::WIRE);
} }
#elif HAS_WIRE #elif HAS_WIRE

View File

@ -647,7 +647,7 @@ void NodeDB::removeNodeByNum(NodeNum nodeNum)
numMeshNodes -= removed; numMeshNodes -= removed;
std::fill(devicestate.node_db_lite.begin() + numMeshNodes, devicestate.node_db_lite.begin() + numMeshNodes + 1, std::fill(devicestate.node_db_lite.begin() + numMeshNodes, devicestate.node_db_lite.begin() + numMeshNodes + 1,
meshtastic_NodeInfoLite()); meshtastic_NodeInfoLite());
LOG_DEBUG("NodeDB::removeNodeByNum purged %d entries. Save changes...", removed); LOG_DEBUG("NodeDB::removeNodeByNum purged %d entries. Save changes", removed);
saveDeviceStateToDisk(); saveDeviceStateToDisk();
} }
@ -976,7 +976,7 @@ bool NodeDB::saveToDisk(int saveWhat)
bool success = saveToDiskNoRetry(saveWhat); bool success = saveToDiskNoRetry(saveWhat);
if (!success) { if (!success) {
LOG_ERROR("Failed to save to disk, retrying..."); LOG_ERROR("Failed to save to disk, retrying");
#ifdef ARCH_NRF52 // @geeksville is not ready yet to say we should do this on other platforms. See bug #4184 discussion #ifdef ARCH_NRF52 // @geeksville is not ready yet to say we should do this on other platforms. See bug #4184 discussion
FSCom.format(); FSCom.format();
@ -1152,7 +1152,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
// We just changed something about the user, store our DB // We just changed something about the user, store our DB
Throttle::execute( Throttle::execute(
&lastNodeDbSave, ONE_MINUTE_MS, []() { nodeDB->saveToDisk(SEGMENT_DEVICESTATE); }, &lastNodeDbSave, ONE_MINUTE_MS, []() { nodeDB->saveToDisk(SEGMENT_DEVICESTATE); },
[]() { LOG_DEBUG("Deferring NodeDB saveToDisk for now"); }); // since we saved less than a minute ago []() { LOG_DEBUG("Defer NodeDB saveToDisk for now"); }); // since we saved less than a minute ago
} }
return changed; return changed;
@ -1282,7 +1282,7 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
// Currently portuino is mostly used for simulation. Make sure the user notices something really bad happened // Currently portuino is mostly used for simulation. Make sure the user notices something really bad happened
#ifdef ARCH_PORTDUINO #ifdef ARCH_PORTDUINO
LOG_ERROR("A critical failure occurred, portduino is exiting..."); LOG_ERROR("A critical failure occurred, portduino is exiting");
exit(2); exit(2);
#endif #endif
} }

View File

@ -230,7 +230,7 @@ bool RF95Interface::reconfigure()
err = lora->setPreambleLength(preambleLength); err = lora->setPreambleLength(preambleLength);
if (err != RADIOLIB_ERR_NONE) if (err != RADIOLIB_ERR_NONE)
LOG_ERROR(" RF95 setPreambleLength %s%d", radioLibErr, err); LOG_ERROR("RF95 setPreambleLength %s%d", radioLibErr, err);
assert(err == RADIOLIB_ERR_NONE); assert(err == RADIOLIB_ERR_NONE);
err = lora->setFrequency(getFreq()); err = lora->setFrequency(getFreq());

View File

@ -71,7 +71,7 @@ template <typename T> bool SX128xInterface<T>::init()
LOG_INFO("SX128x init result %d", res); LOG_INFO("SX128x init result %d", res);
if ((config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (res == RADIOLIB_ERR_INVALID_FREQUENCY)) { if ((config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (res == RADIOLIB_ERR_INVALID_FREQUENCY)) {
LOG_WARN("Radio chip only supports 2.4GHz LoRa. Adjusting Region and rebooting."); LOG_WARN("Radio only supports 2.4GHz LoRa. Adjusting Region and rebooting");
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_LORA_24; config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_LORA_24;
nodeDB->saveToDisk(SEGMENT_CONFIG); nodeDB->saveToDisk(SEGMENT_CONFIG);
delay(2000); delay(2000);
@ -80,7 +80,7 @@ template <typename T> bool SX128xInterface<T>::init()
#elif defined(ARCH_NRF52) #elif defined(ARCH_NRF52)
NVIC_SystemReset(); NVIC_SystemReset();
#else #else
LOG_ERROR("FIXME implement reboot for this platform. Skip for now."); LOG_ERROR("FIXME implement reboot for this platform. Skip for now");
#endif #endif
} }

View File

@ -141,13 +141,13 @@ bool initEthernet()
if (status == 0) { if (status == 0) {
if (Ethernet.hardwareStatus() == EthernetNoHardware) { if (Ethernet.hardwareStatus() == EthernetNoHardware) {
LOG_ERROR("Ethernet shield was not found."); LOG_ERROR("Ethernet shield was not found");
return false; return false;
} else if (Ethernet.linkStatus() == LinkOFF) { } else if (Ethernet.linkStatus() == LinkOFF) {
LOG_ERROR("Ethernet cable is not connected."); LOG_ERROR("Ethernet cable is not connected");
return false; return false;
} else { } else {
LOG_ERROR("Unknown Ethernet error."); LOG_ERROR("Unknown Ethernet error");
return false; return false;
} }
} else { } else {

View File

@ -441,8 +441,8 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res)
return; return;
} else { } else {
LOG_ERROR("This should not have happened..."); LOG_ERROR("This should not have happened");
res->println("ERROR: This should not have happened..."); res->println("ERROR: This should not have happened");
} }
} }

View File

@ -95,7 +95,7 @@ static void taskCreateCert(void *parameter)
LOG_DEBUG("Retrieved Certificate: %d Bytes", cert->getCertLength()); LOG_DEBUG("Retrieved Certificate: %d Bytes", cert->getCertLength());
} else { } else {
LOG_INFO("Creating the certificate. This may take a while. Please wait..."); LOG_INFO("Creating the certificate. This may take a while. Please wait");
yield(); yield();
cert = new SSLCert(); cert = new SSLCert();
yield(); yield();
@ -189,7 +189,7 @@ int32_t WebServerThread::runOnce()
void initWebServer() void initWebServer()
{ {
LOG_DEBUG("Init Web Server..."); LOG_DEBUG("Init Web Server");
// We can now use the new certificate to setup our server as usual. // We can now use the new certificate to setup our server as usual.
secureServer = new HTTPSServer(cert); secureServer = new HTTPSServer(cert);
@ -198,10 +198,10 @@ void initWebServer()
registerHandlers(insecureServer, secureServer); registerHandlers(insecureServer, secureServer);
if (secureServer) { if (secureServer) {
LOG_INFO("Start Secure Web Server..."); LOG_INFO("Start Secure Web Server");
secureServer->start(); secureServer->start();
} }
LOG_INFO("Start Insecure Web Server..."); LOG_INFO("Start Insecure Web Server");
insecureServer->start(); insecureServer->start();
if (insecureServer->isRunning()) { if (insecureServer->isRunning()) {
LOG_INFO("Web Servers Ready! :-) "); LOG_INFO("Web Servers Ready! :-) ");

View File

@ -369,7 +369,7 @@ void AdminModule::handleGetModuleConfigResponse(const meshtastic_MeshPacket &mp,
// Skip if it's disabled or no pins are exposed // Skip if it's disabled or no pins are exposed
if (!r->get_module_config_response.payload_variant.remote_hardware.enabled || if (!r->get_module_config_response.payload_variant.remote_hardware.enabled ||
r->get_module_config_response.payload_variant.remote_hardware.available_pins_count == 0) { r->get_module_config_response.payload_variant.remote_hardware.available_pins_count == 0) {
LOG_DEBUG("Remote hardware module disabled or no available_pins. Skip..."); LOG_DEBUG("Remote hardware module disabled or no available_pins. Skip");
return; return;
} }
for (uint8_t i = 0; i < devicestate.node_remote_hardware_pins_count; i++) { for (uint8_t i = 0; i < devicestate.node_remote_hardware_pins_count; i++) {

View File

@ -76,7 +76,7 @@ int32_t DetectionSensorModule::runOnce()
if (moduleConfig.detection_sensor.monitor_pin > 0) { if (moduleConfig.detection_sensor.monitor_pin > 0) {
pinMode(moduleConfig.detection_sensor.monitor_pin, moduleConfig.detection_sensor.use_pullup ? INPUT_PULLUP : INPUT); pinMode(moduleConfig.detection_sensor.monitor_pin, moduleConfig.detection_sensor.use_pullup ? INPUT_PULLUP : INPUT);
} else { } else {
LOG_WARN("Detection Sensor Module: Set to enabled but no monitor pin is set. Disable module..."); LOG_WARN("Detection Sensor Module: Set to enabled but no monitor pin is set. Disable module");
return disable(); return disable();
} }
LOG_INFO("Detection Sensor Module: init"); LOG_INFO("Detection Sensor Module: init");

View File

@ -70,11 +70,11 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply()
} }
// If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway. // If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway.
if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 5 * 60 * 1000)) { if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 5 * 60 * 1000)) {
LOG_DEBUG("Skip send NodeInfo since we sent it <5 mins ago."); LOG_DEBUG("Skip send NodeInfo since we sent it <5min ago");
ignoreRequest = true; // Mark it as ignored for MeshModule ignoreRequest = true; // Mark it as ignored for MeshModule
return NULL; return NULL;
} else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) { } else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) {
LOG_DEBUG("Skip send requested NodeInfo since we sent it <60s ago."); LOG_DEBUG("Skip send NodeInfo since we sent it <60s ago");
ignoreRequest = true; // Mark it as ignored for MeshModule ignoreRequest = true; // Mark it as ignored for MeshModule
return NULL; return NULL;
} else { } else {

View File

@ -249,10 +249,10 @@ meshtastic_MeshPacket *PositionModule::allocReply()
// nodes shouldn't trust it anyways) Note: we allow a device with a local GPS or NTP to include the time, so that devices // nodes shouldn't trust it anyways) Note: we allow a device with a local GPS or NTP to include the time, so that devices
// without can get time. // without can get time.
if (getRTCQuality() < RTCQualityNTP) { if (getRTCQuality() < RTCQualityNTP) {
LOG_INFO("Strip time %u from position send", p.time); LOG_INFO("Strip time %u from position", p.time);
p.time = 0; p.time = 0;
} else if (rtc_found.address != ScanI2C::ADDRESS_NONE.address) { } else if (rtc_found.address != ScanI2C::ADDRESS_NONE.address) {
LOG_INFO("Using RTC time %u for position send", p.time); LOG_INFO("Use RTC time %u for position", p.time);
p.time = getValidTime(RTCQualityDevice); p.time = getValidTime(RTCQualityDevice);
} else { } else {
p.time = getValidTime(RTCQualityNTP); p.time = getValidTime(RTCQualityNTP);

View File

@ -31,7 +31,7 @@ class TelemetrySensor
int32_t initI2CSensor() int32_t initI2CSensor()
{ {
if (!status) { if (!status) {
LOG_WARN("Could not connect to detected %s sensor. Remove from nodeTelemetrySensorsMap.", sensorName); LOG_WARN("Can't connect to detected %s sensor. Remove from nodeTelemetrySensorsMap", sensorName);
nodeTelemetrySensorsMap[sensorType].first = 0; nodeTelemetrySensorsMap[sensorType].first = 0;
} else { } else {
LOG_INFO("Opened %s sensor on i2c bus", sensorName); LOG_INFO("Opened %s sensor on i2c bus", sensorName);

View File

@ -32,7 +32,7 @@ void powerCommandsCheck()
reboot(); reboot();
#else #else
rebootAtMsec = -1; rebootAtMsec = -1;
LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied."); LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied");
#endif #endif
} }