RF24Log  0.1.3
Unified logging library
OStreamLogger.h
Go to the documentation of this file.
1 
14 #ifndef ARDUINO
15 #ifndef SRC_RF24LOGGERS_OSTREAMLOGGER_H_
16 #define SRC_RF24LOGGERS_OSTREAMLOGGER_H_
17 
18 #include <ostream>
19 #include "../RF24LogParts/PrintfParser.h"
20 #include "../RF24LogParts/LevelDescriptions.h"
21 
24 {
25 public:
30  OStreamLogger(std::ostream* stream);
31 
32 private:
33 
35  std::ostream* _stream;
36 
37 protected:
38 
39  // declare the rest to raise from pure virtual
40  /************************************************/
41 
42  void appendTimestamp();
43  void appendChar(char data, uint16_t depth = 1);
44  void appendInt(long data);
45  void appendUInt(unsigned long data, uint8_t base = 10);
46  void appendDouble(double data, uint8_t precision = 2);
47  void appendStr(const char* data);
48 };
49 
50 #ifndef PROGMEM
51 #define PROGMEM
52 #endif
53 
54 #endif // SRC_RF24LOGGERS_OSTREAMLOGGER_H_
55 #endif // !defined(ARDUINO)
Class to manage logging messages to a ostream based object.
Definition: OStreamLogger.h:24
void appendTimestamp()
output a timestamp
void appendChar(char data, uint16_t depth=1)
append a character a number of times
OStreamLogger(std::ostream *stream)
Construct a new OStreamLogger object.
void appendDouble(double data, uint8_t precision=2)
append a floating point number
void appendStr(const char *data)
append a c-string
void appendInt(long data)
append a signed (+/-) number
void appendUInt(unsigned long data, uint8_t base=10)
append an ‘unsigned’ (only +) number
class that holds the RF24Log's in-house printf-like parsing
Definition: PrintfParser.h:25