LoomLogPlat class

Abstract base of logging platforms.

All logging modules inherit from this class.

Base classes

class LoomModule
Abstract root of Loom component modules inheritance hierarchy.

Derived classes

class Loom_BatchSD
Batch SD logging platform module.
class Loom_OLED
OLED logging platform module.
class Loom_SD
SD logging platform module.

Protected variables

bool enable_rate_filter
Whether or not to enable a minimum delay between logging.
uint16_t min_filter_delay
Minimum delay between logging (milliseconds)
unsigned long last_log_millis
Value of millis() at last executed log time.

CONSTRUCTORS / DESTRUCTOR

LoomLogPlat(LoomManager* manager, const char* module_name, const LoomModule::Type module_type, const bool enable_rate_filter = true, const uint16_t min_filter_delay = 1000)
Constructor.
~LoomLogPlat() defaulted virtual
Destructor.

OPERATION

void package(JsonObject json) override
No package necessary for logging platforms.
auto log(JsonObject json) -> bool pure virtual
Log a Json object.
auto log() -> bool
Version of log for use with LoomManager.

Function documentation

LoomLogPlat::LoomLogPlat(LoomManager* manager, const char* module_name, const LoomModule::Type module_type, const bool enable_rate_filter = true, const uint16_t min_filter_delay = 1000)

Constructor.

Parameters
manager
module_name in Name of the module (provided by derived classes)
module_type in Type of the module (provided by derived classes)
enable_rate_filter in Whether or not to impose maximum update rate
min_filter_delay in Minimum update delay, if enable_rate_filter enabled

void LoomLogPlat::package(JsonObject json) override

No package necessary for logging platforms.

implement with empty body.

bool LoomLogPlat::log(JsonObject json) pure virtual

Log a Json object.

Parameters
json in Json Object to log

bool LoomLogPlat::log()

Version of log for use with LoomManager.

Accesses Json from LoomManager. Calls derived classes implementations of log(JsonObject json)

bool LoomLogPlat::check_millis() protected

Check against millis to determine if time since last log exceeds min time.

Returns True if enough time has elapsed