This example uses a handler extension to forward log messages to 2 simultaneous out put streams. This example accepts user input to change the log level used as a filter.
30 const char PROGMEM vendorID[] =
"RF24LogExample";
31 const char PROGMEM DisableVendor[] =
"";
47 RF24Log_info(vendorID,
"RF24Log/examples/DualLogger%\n");
54 bool is_2nd_handler_enabled_for_info;
57 "This info message should be logged %s because serialLogHandler2 verbosity is %o.",
58 (is_2nd_handler_enabled_for_info ?
"once" :
"twice"),
63 RF24Log_debug(vendorID,
"This debug message should be logged once.");
66 RF24Log_log(0, DisableVendor,
"\nEnter a log level (in octal form) to demonstrate filtering messages (for the second handler)\n");
70 if (Serial.available()) {
72 char input = Serial.read();
73 while (Serial.available() && input >= 48 && input < 56) {
76 input = Serial.read();
78 RF24Log_log(0, DisableVendor,
"Setting log level (in octal) to %o (for the second handler)", level);
79 serialLogHandler2.setLogLevel(level);
handler for Print::print() function calls based on Arduino API
handler extention to manage 2 handlers
Provides rf24Logging singleton for accessing the Logging API.
A log handler implementation which outputs log messages to a stream.
Module to extend the RF24LogBaseHandler mechanism for redirecting to 2 different RF24LogBaseHandler o...
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
RF24Logging rf24Logging
default logger instance