SdCardLogHandlerRK
Public Member Functions
SdCardLogHandler Class Reference

Class for logging to SD card. More...

#include <SdCardLogHandlerRK.h>

Inheritance diagram for SdCardLogHandler:
SdCardPrintHandler

Public Member Functions

 SdCardLogHandler (SdFat &sd, uint8_t csPin, uint8_t divisor, LogLevel level=LOG_LEVEL_INFO, LogCategoryFilters filters={})
 Constructor. The object is normally instantiated as a global object. More...
 
virtual size_t write (uint8_t)
 Virtual override for the StreamLogHandler to write data to the log.
 

Detailed Description

Class for logging to SD card.

You normally instantiate one of these as a global variable, passing in the SdFat object and the parameters you'd normally pass to SdFat::begin(). You can optionally pass the LogLevel and LogCategoryFilters parameters you'd pass to the LogHandler constructor.

const int SD_CHIP_SELECT = A2;
SdFat sd;
SdCardLogHandler logHandler(sd, SD_CHIP_SELECT, SPI_FULL_SPEED);

You can pass additional options using the fluent-style methods beginning with "with" like withLogsDirName().

Constructor & Destructor Documentation

◆ SdCardLogHandler()

SdCardLogHandler::SdCardLogHandler ( SdFat &  sd,
uint8_t  csPin,
uint8_t  divisor,
LogLevel  level = LOG_LEVEL_INFO,
LogCategoryFilters  filters = {} 
)

Constructor. The object is normally instantiated as a global object.

Parameters
sdThe SdFat object, normally allocated a global object.
csPinThe pin used for the SPI chip select for the SD card reader
divisorUsually either SPI_FULL_SPEED or SPI_HALF_SPEED.
level(optional, default is LOG_LEVEL_INFO)
filters(optional, default is none)

The documentation for this class was generated from the following files: