RF24Log  0.1.3
Unified logging library
AbstractHandler.h
Go to the documentation of this file.
1 
16 #ifndef SRC_RF24LOGPARTS_HANDLER_H_
17 #define SRC_RF24LOGPARTS_HANDLER_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 <stdarg.h>
27 
28 #include "../RF24LogBaseHandler.h"
29 #include "../RF24LogLevel.h"
30 
31 
34 {
35 private:
36 
42  bool isLevelEnabled(uint8_t logLevel);
43 
44 public:
45 
48 
49  void log(uint8_t logLevel,
50  const char *vendorId,
51  const char *message,
52  va_list *args);
53 
54  void setLogLevel(uint8_t logLevel);
55 
56 #if defined (ARDUINO_ARCH_AVR)
57  void log(uint8_t logLevel,
58  const __FlashStringHelper *vendorId,
59  const __FlashStringHelper *message,
60  va_list *args);
61 #endif
62 
63 protected:
64 
66  uint8_t _logLevel;
67 
76  virtual void write(uint8_t logLevel,
77  const char *vendorId,
78  const char *message,
79  va_list *args) = 0;
80 
81 #if defined (ARDUINO_ARCH_AVR)
82  virtual void write(uint8_t logLevel,
83  const __FlashStringHelper *vendorId,
84  const __FlashStringHelper *message,
85  va_list *args) = 0;
86 #endif
87 };
88 
89 
90 #endif /* SRC_RF24LOGPARTS_HANDLER_H_ */
An abstract base class for handling log messages.
void log(uint8_t logLevel, const char *vendorId, const char *message, va_list *args)
log a message.
RF24LogAbstractHandler()
Sets log level to INFO upon instantiation.
virtual void write(uint8_t logLevel, const char *vendorId, const char *message, va_list *args)=0
void setLogLevel(uint8_t logLevel)
A base mechanism for handling log messages.