Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/platformio-basic/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/ArduinoLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,6 @@ void Logging::printFormat(const char format, va_list *args) {
#endif
}

#ifndef DISABLE_LOGGING
template<typename... Args> 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
10 changes: 9 additions & 1 deletion src/ArduinoLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,15 @@ class Logging {
Print* _logOutputs[LOG_MAX_HANDLERS];
int _handlerCount;

template<typename... Args> void writeLog(Args... args);
#ifndef DISABLE_LOGGING
template<typename... Args> 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
Expand Down