Skip to content

Add Event system

Currently, blocks log to std::cout which is not very satisfying.

Instead, blocks should interface with the outside world by triggering events. These inherit from an abstract base class. Examples are:

  • Log messages
  • Error messages
  • Block processing begin/end
  • File written

All blocks have a string message, but they might hold additional data.

A singleton class receives and distributes events to listeners. Examples are:

  • std::cout logger
  • file logger
  • frontend interface APIs (e.g. turning events into HTTP requests)

The concept of a log level should be implemented and be configurable globally and on a per-block basis.