RF24Log  0.1.3
Unified logging library
ArduinoPrintLogger.h
Go to the documentation of this file.
1 
16 #ifndef SRC_RF24LOGGERS_ARDUINOPRINTLOGGER_H_
17 #define SRC_RF24LOGGERS_ARDUINOPRINTLOGGER_H_
18 
19 #include <Print.h>
20 #include "../RF24LogParts/PrintfParser.h"
21 #include "../RF24LogParts/LevelDescriptions.h"
22 
25 {
26 protected:
27 
29  Print* _stream;
30 
31 public:
32 
37  ArduinoPrintLogger(Print *stream);
38 
39 protected:
40 
41  // declare the rest to raise from pure virtual
42  /************************************************/
43  void appendTimestamp();
44  void appendChar(char data, uint16_t depth = 1);
45  void appendInt(long data);
46  void appendUInt(unsigned long data, uint8_t base = 10);
47  void appendDouble(double data, uint8_t precision = 2);
48  void appendStr(const char* data);
49 #ifdef ARDUINO_ARCH_AVR
50  void appendStr(const __FlashStringHelper* data);
51 #endif
52 };
53 
54 #endif /* SRC_RF24LOGGERS_ARDUINOPRINTLOGGER_H_ */
A log handler implementation which outputs log messages to a stream.
void appendTimestamp()
output a timestamp
void appendInt(long data)
append a signed (+/-) number
void appendStr(const char *data)
append a c-string
ArduinoPrintLogger(Print *stream)
instance constructor
void appendChar(char data, uint16_t depth=1)
append a character a number of times
void appendUInt(unsigned long data, uint8_t base=10)
append an ‘unsigned’ (only +) number
Print * _stream
The output stream.
void appendDouble(double data, uint8_t precision=2)
append a floating point number
class that holds the RF24Log's in-house printf-like parsing
Definition: PrintfParser.h:25