24 const char PROGMEM vendorID[] =
"RF24LogExample";
25 const char PROGMEM DisableVendor[] =
"";
38 RF24Log_info(vendorID,
"RF24Log/examples/gettingStarted%\n");
43 RF24Log_warn(vendorID,
"Warn with error code = 0x%x%x%x%x", 222, 173, 190, 239);
44 RF24Log_error(vendorID,
"Error message with %s",
"RAM string");
45 RF24Log_info(vendorID,
"Info about rounding a double value %.4D", 3.14159);
46 RF24Log_debug(vendorID,
"Debug precision of a double value %.4D", 2.71);
54 RF24Log_log(077, vendorID,
"This\n\tis a multiline\n\t\tmessage that\n\tends with a\nblank line\n\n");
55 RF24Log_log(75, vendorID,
"%%%%This is level 0x%02x (0b%08b or%4d)%2c", 75, 75, 75,
'!');
58 RF24Log_log((uint8_t)(-0xAA), vendorID,
"0x%02x is 0b%08b is %d, but can also be %hho", (uint8_t)(-0xAA), (uint8_t)(-0xAA), -0xAA, -0xAA);
61 RF24Log_log(0, DisableVendor,
"\nEnter a log level (in octal form) to demonstrate filtering messages\n");
66 if (Serial.available()) {
67 char input = Serial.read();
68 while (Serial.available() && input >= 48 && input < 56) {
71 input = Serial.read();
73 RF24Log_log(0, DisableVendor,
"Setting log level (in octal) to %o", level);
74 serialLogHandler.setLogLevel(level);
handler for Print::print() function calls based on Arduino API
Provides rf24Logging singleton for accessing the Logging API.
A log handler implementation which outputs log messages to a stream.
void setHandler(RF24LogBaseHandler *handler)
set the instance's handler
#define RF24Log_log(logLevel, vendorId, message,...)
output a log message of any level
#define RF24Log_debug(vendorId, message,...)
output a message to help developers DEBUG their source code
#define RF24Log_info(vendorId, message,...)
output an INFO message
#define RF24Log_error(vendorId, message,...)
ouput an ERROR message
RF24Logging rf24Logging
default logger instance
#define RF24Log_warn(vendorId, message,...)
output a message to WARN the reader