Skip to content

Fix udplogger header/implementation signature mismatch and refactor logString#90

Closed
techniccontroller with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-translate-comments-to-german
Closed

Fix udplogger header/implementation signature mismatch and refactor logString#90
techniccontroller with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-translate-comments-to-german

Conversation

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown

udplogger.h declared logString(String) while the implementation used logString(const String&), causing a compile/link failure. This PR aligns both and applies the underlying refactor.

Changes

  • udplogger.h: Updated logString declaration to const String& logmessage to match the implementation
  • udplogger.cpp:
    • Changed logString to take const String& — avoids an unnecessary copy on every call
    • Replaced string concatenation + toCharArray with snprintf into the existing _packetBuffer — eliminates intermediate heap allocations triggered on every NTP sync (every 30s)
    • All new comments written in German
// Before
void UDPLogger::logString(String logmessage) {
    logmessage = _name + ": " + logmessage;  // heap alloc
    Serial.println(logmessage);
    logmessage.toCharArray(_packetBuffer, 100);

// After
void UDPLogger::logString(const String& logmessage) {
    snprintf(_packetBuffer, sizeof(_packetBuffer), "%s: %s", _name.c_str(), logmessage.c_str());
    Serial.println(_packetBuffer);

Copilot AI changed the title [WIP] Fix code comments by translating to German Fix udplogger header/implementation signature mismatch and refactor logString Jul 11, 2026
Copilot AI requested a review from techniccontroller July 11, 2026 20:38
@techniccontroller

Copy link
Copy Markdown
Owner

@copilot Comments in the code should be in english

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Author

@copilot Comments in the code should be in english

Done — comments are now in English (commit Translate code comments back to English).

@techniccontroller techniccontroller marked this pull request as ready for review July 11, 2026 20:46
@techniccontroller

Copy link
Copy Markdown
Owner

Close as contributor commits are missing in history, instead integration and fix is done in PR #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants