Skip to content

Basic Logging

Andrew Gresyk edited this page Apr 1, 2022 · 2 revisions

Logging

  1. Inherit a class from LoggerInterface to implement a custom logging solution.

Tests

  1. Enable logging support:

    #define FFSM2_ENABLE_LOG_INTERFACE
  2. Log all state methods, not just the user-overriden ones:

    #define FFSM2_ENABLE_VERBOSE_DEBUG_LOG

LoggerInterface

Method Description
virtual void recordMethod(Context&, const StateID, const Method); Record state method call
virtual void recordTransition(Context&, const StateID, const StateID); Record successful transitions
virtual void recordTaskStatus(Context&, const StateID, const StatusEvent);
virtual void recordPlanStatus(Context&, const StatusEvent);
Record task or plan status
virtual void recordCancelledPending(Context&, const StateID); Record a cancelled pending transition
Method Description
Root::Root(const Context&, LoggerInterface* const); Construct an instance with logger attached
void Root::attachLogger(LoggerInterface* const); Attach logger after construction