RF24Log  0.1.3
Unified logging library
AbstractStream.h
Go to the documentation of this file.
1 
16 #ifndef SRC_RF24LOGPARTS_STREAM_H_
17 #define SRC_RF24LOGPARTS_STREAM_H_
18 
19 #if defined (ARDUINO_ARCH_AVR)
20 #include <WString.h> // __FlashStringHelper
21 #else
22 #include <string.h>
23 #endif
24 
25 #include <stdint.h>
26 #include "FormatSpecifier.h" // FormatSpecifier struct
27 #include "Common.h" // numbCharsToPrint()
28 
31 {
32 
33 protected:
34 
36  virtual void appendTimestamp() = 0;
37 
42  void appendLogLevel(uint8_t logLevel);
43 
48  void descTimeLevel(uint8_t logLevel);
49 
55  void appendFormat(FormatSpecifier* fmt_parser, va_list *args);
56 
62  virtual void appendChar(char data, uint16_t depth = 1) = 0;
63 
68  virtual void appendInt(long data) = 0;
69 
75  virtual void appendUInt(unsigned long data, uint8_t base = 10) = 0;
76 
82  virtual void appendDouble(double data, uint8_t precision = 2) = 0;
83 
88  virtual void appendStr(const char* data) = 0;
89 #ifdef ARDUINO_ARCH_AVR
90  virtual void appendStr(const __FlashStringHelper* data) = 0;
91 #endif
92 };
93 
94 #endif /* SRC_RF24LOGPARTS_STREAM_H_ */
global functions for RF24Log Abstract objects.
generic struct that allows customization of a printf-like parser
A protected collection of methods that output formatted data to a stream.
virtual void appendUInt(unsigned long data, uint8_t base=10)=0
append an ‘unsigned’ (only +) number
virtual void appendInt(long data)=0
append a signed (+/-) number
virtual void appendStr(const char *data)=0
append a c-string
void appendLogLevel(uint8_t logLevel)
output a description of the log level
virtual void appendChar(char data, uint16_t depth=1)=0
append a character a number of times
void appendFormat(FormatSpecifier *fmt_parser, va_list *args)
output a data according to the format specifier
virtual void appendTimestamp()=0
output a timestamp
void descTimeLevel(uint8_t logLevel)
Automate the output of the header' timestamp and level description.
virtual void appendDouble(double data, uint8_t precision=2)=0
append a floating point number
Some data about a format specifier.