A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: chore: make all debug messages uniform (#825)

## Summary

* Unify all serial port debug messages

## Additional Context

* All messages sent to the serial port now follow the "[timestamp]
[origin] payload" format (notable exception framework messages)

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? No

authored by

jpirnay and committed by
GitHub
3ae1007c efb9b72e

+11 -11
+1 -1
src/RecentBooksStore.cpp
··· 83 83 lastBookFileName = path.substr(lastSlash + 1); 84 84 } 85 85 86 - Serial.printf("Loading recent book: %s\n", path.c_str()); 86 + Serial.printf("[%lu] [RBS] Loading recent book: %s\n", millis(), path.c_str()); 87 87 88 88 // If epub, try to load the metadata for title/author and cover 89 89 if (StringUtils::checkFileExtension(lastBookFileName, ".epub")) {
+7 -7
src/activities/boot_sleep/SleepActivity.cpp
··· 218 218 // Handle XTC file 219 219 Xtc lastXtc(APP_STATE.openEpubPath, "/.crosspoint"); 220 220 if (!lastXtc.load()) { 221 - Serial.println("[SLP] Failed to load last XTC"); 221 + Serial.printf("[%lu] [SLP] Failed to load last XTC\n", millis()); 222 222 return (this->*renderNoCoverSleepScreen)(); 223 223 } 224 224 225 225 if (!lastXtc.generateCoverBmp()) { 226 - Serial.println("[SLP] Failed to generate XTC cover bmp"); 226 + Serial.printf("[%lu] [SLP] Failed to generate XTC cover bmp\n", millis()); 227 227 return (this->*renderNoCoverSleepScreen)(); 228 228 } 229 229 ··· 232 232 // Handle TXT file - looks for cover image in the same folder 233 233 Txt lastTxt(APP_STATE.openEpubPath, "/.crosspoint"); 234 234 if (!lastTxt.load()) { 235 - Serial.println("[SLP] Failed to load last TXT"); 235 + Serial.printf("[%lu] [SLP] Failed to load last TXT\n", millis()); 236 236 return (this->*renderNoCoverSleepScreen)(); 237 237 } 238 238 239 239 if (!lastTxt.generateCoverBmp()) { 240 - Serial.println("[SLP] No cover image found for TXT file"); 240 + Serial.printf("[%lu] [SLP] No cover image found for TXT file\n", millis()); 241 241 return (this->*renderNoCoverSleepScreen)(); 242 242 } 243 243 ··· 247 247 Epub lastEpub(APP_STATE.openEpubPath, "/.crosspoint"); 248 248 // Skip loading css since we only need metadata here 249 249 if (!lastEpub.load(true, true)) { 250 - Serial.println("[SLP] Failed to load last epub"); 250 + Serial.printf("[%lu] [SLP] Failed to load last epub\n", millis()); 251 251 return (this->*renderNoCoverSleepScreen)(); 252 252 } 253 253 254 254 if (!lastEpub.generateCoverBmp(cropped)) { 255 - Serial.println("[SLP] Failed to generate cover bmp"); 255 + Serial.printf("[%lu] [SLP] Failed to generate cover bmp\n", millis()); 256 256 return (this->*renderNoCoverSleepScreen)(); 257 257 } 258 258 ··· 265 265 if (Storage.openFileForRead("SLP", coverBmpPath, file)) { 266 266 Bitmap bitmap(file); 267 267 if (bitmap.parseHeaders() == BmpReaderError::Ok) { 268 - Serial.printf("[SLP] Rendering sleep cover: %s\n", coverBmpPath.c_str()); 268 + Serial.printf("[%lu] [SLP] Rendering sleep cover: %s\n", millis(), coverBmpPath.c_str()); 269 269 renderBitmapSleepScreen(bitmap); 270 270 return; 271 271 }
+1 -1
src/activities/home/RecentBooksActivity.cpp
··· 73 73 74 74 if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { 75 75 if (!recentBooks.empty() && selectorIndex < static_cast<int>(recentBooks.size())) { 76 - Serial.printf("Selected recent book: %s\n", recentBooks[selectorIndex].path.c_str()); 76 + Serial.printf("[%lu] [RBA] Selected recent book: %s\n", millis(), recentBooks[selectorIndex].path.c_str()); 77 77 onSelectBook(recentBooks[selectorIndex].path); 78 78 return; 79 79 }
+2 -2
src/activities/reader/EpubReaderActivity.cpp
··· 664 664 data[5] = (pageCount >> 8) & 0xFF; 665 665 f.write(data, 6); 666 666 f.close(); 667 - Serial.printf("[ERS] Progress saved: Chapter %d, Page %d\n", spineIndex, currentPage); 667 + Serial.printf("[%lu] [ERS] Progress saved: Chapter %d, Page %d\n", millis(), spineIndex, currentPage); 668 668 } else { 669 - Serial.printf("[ERS] Could not save progress!\n"); 669 + Serial.printf("[%lu] [ERS] Could not save progress!\n", millis()); 670 670 } 671 671 } 672 672 void EpubReaderActivity::renderContents(std::unique_ptr<Page> page, const int orientedMarginTop,