Skip to content

Commit 4003c44

Browse files
committed
Added LogArduino
1 parent 89b5c1f commit 4003c44

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ArduinoStreamLogger",
3-
"version": "1.1.9",
3+
"version": "1.1.10",
44
"description": "Simple ostream logger",
55
"keywords": "logger, logging, log, ostream, stream",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=vovagorodok_ArduinoStreamLogger
2-
version=1.1.9
2+
version=1.1.10
33
author=vovagorodok
44
maintainer=vovagorodok <vovagorodok2@gmail.com>
55
sentence=Simple ostream logger

src/LogArduino.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pragma once
2+
#if defined(ARDUINO) || defined(ARDUINO_FAKE)
3+
#include <Arduino.h>
4+
#define LOG_ARDUINO
5+
#endif

src/LogEntry.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include "LogLevel.h"
33
#include "LogUtils.h"
4-
#include <Arduino.h>
4+
#include "LogArduino.h"
55

66
template <LogLevel level>
77
struct LogEntry {
@@ -27,12 +27,14 @@ struct LogEntry {
2727
return *this;
2828
}
2929

30+
#ifdef LOG_ARDUINO
3031
inline LogEntry& operator<<(const String& value) {
3132
#if !defined(LOG_LEVEL_DISABLED) && !defined(LOG_LVL_DISABLED)
3233
std::cout << value.c_str();
3334
#endif
3435
return *this;
3536
}
37+
#endif
3638
};
3739

3840
template <LogLevel level>

0 commit comments

Comments
 (0)