This example just prints a messaged for each supported log level. This example accepts user input to change the log level used as a filter.
24 const char PROGMEM vendorID[] =
"RF24LogExample";
25 const char PROGMEM DisableVendor[] =
"";
38 RF24Log_info(vendorID,
"RF24Log/examples/AllLogLevelsLogger%\n");
45 RF24Log_log(lvl, vendorID,
"A log message from %s on level %3d",
"loop()", lvl);
50 RF24Log_log(0, DisableVendor,
"\nEnter a log level (in octal form) to demonstrate filtering messages\n");
55 if (Serial.available()) {
56 char input = Serial.read();
57 while (Serial.available() && input >= 48 && input < 56) {
60 input = Serial.read();
62 RF24Log_log(0, DisableVendor,
"Setting log level (in octal) to %o", level);
63 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_info(vendorId, message,...)
output an INFO message
RF24Logging rf24Logging
default logger instance