This repository has been archived by the owner on Sep 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Logger Interface
Andrew Gresyk edited this page Jun 30, 2018
·
5 revisions
It is often useful to see the history of state transitions and state method calls. One option for that would be by putting log statements in every method, which can be tedious and error prone.
HFSM also provides the interface for attachable logger, for a more convenient solution, removing the need to clutter user state code with the custom logging code:
// enable logger functionality
#define HFSM_ENABLE_STRUCTURE_REPORT
#include <hfsm/machine_single.hpp>
namespace hfsm {
struct LoggerInterface {
enum class Method {
Substitute,
Enter,
Update,
Transition,
React,
Leave,
};
virtual void record(const char* state, const Method method) = 0;
};
} // namespace hfsm
Source code: debug logger interface example
- Core principles
- Another FSM lib?
- NoUML compliance
- Proactive vs. reactive approach
- Gamedev requirements
- Alternatives
- Context and M:: 'namespace'
- Basic state methods
- Basic transitions
- Roots and regions
- Transitions within hierarchy
- Active chain
- Quering state activation status
- Substitutions, aka State guards on steroids
- State reuse with injections
- Event handling
- Structure and activity report API
- Assisted debugging with custom .natvis
- Logger interface