11SPIClass spi_logger = SPIClass(VSPI);
14 Elog *logger =
new Elog();
15 const char *serviceName;
18 serviceName =
"BROKER";
21 serviceName =
"PUBLISHER";
24 serviceName =
"SUBSCRIBER";
27 serviceName =
"UNKNOWN";
30 logger->addSerialLogging(Serial, serviceName, level);
35 Elog *logger =
new Elog();
36 const char *filepath =
"LMQ.log";
38 spi_logger.begin(sck, miso, mosi, cs);
44 "Could not start SD logging, check the SD card pins and the card itself. Logs will be printed to Serial.");
46 logger->configureSd(spi_logger, cs, 2000000);
47 logger->addSdLogging(filepath, level);
Elog * initializeSerialLogger(LoggerClass className, Loglevel level)
Creates a logger that prints messages to the serial monitor.
Elog * disableLogger()
Creates a logger without the ability to print messages.
Elog * initializeSDLogger(LoggerClass className, int cs, int sck, int miso, int mosi, Loglevel level)
Creates a logger that prints messages to a file inside a SD card.
LoggerClass
Enumerates every log class that represents the part of the library which is being logged.
@ SUBSCRIBER
Subscriber log class.
@ BROKER
Broker log class.
@ UNKNOWN
Log class unknown or generic.
@ PUBLISHER
Publisher log class.