diff --git a/examples/platformio-basic/src/main.cpp b/examples/platformio-basic/src/main.cpp index 0a87923..b4e6338 100644 --- a/examples/platformio-basic/src/main.cpp +++ b/examples/platformio-basic/src/main.cpp @@ -23,13 +23,13 @@ String stringValue1 = "this is a string"; float floatValue; double doubleValue; -void printTimestamp(Print *_logOutput) { +void printTimestamp(Print *_logOutput, int) { char c[12]; int m = sprintf(c, "%10lu ", millis()); _logOutput->print(c); } -void printCarret(Print *_logOutput) { _logOutput->print('>'); } +void printCarret(Print *_logOutput, int) { _logOutput->print('>'); } void setup() { // Set up serial port and wait until connected diff --git a/src/ArduinoLog.cpp b/src/ArduinoLog.cpp index d2f27a0..b9e3a82 100644 --- a/src/ArduinoLog.cpp +++ b/src/ArduinoLog.cpp @@ -279,16 +279,6 @@ void Logging::printFormat(const char format, va_list *args) { #endif } -#ifndef DISABLE_LOGGING -template void Logging::writeLog(Args... args) { - for (int i = 0; i < _handlerCount; i++) { - if (_logOutputs[i]) { - _logOutputs[i]->print(args...); - } - } -} -#endif - #ifndef __DO_NOT_INSTANTIATE__ Logging Log = Logging(); #endif diff --git a/src/ArduinoLog.h b/src/ArduinoLog.h index 71b82e1..2d1e949 100644 --- a/src/ArduinoLog.h +++ b/src/ArduinoLog.h @@ -450,7 +450,15 @@ class Logging { Print* _logOutputs[LOG_MAX_HANDLERS]; int _handlerCount; - template void writeLog(Args... args); +#ifndef DISABLE_LOGGING + template void writeLog(Args... args) { + for (int i = 0; i < _handlerCount; i++) { + if (_logOutputs[i]) { + _logOutputs[i]->print(args...); + } + } + } +#endif #ifdef ESP32 SemaphoreHandle_t _semaphore; #endif