abstract class Sepia::EventLoggerBackend

Overview

Abstract base class for event logging backends.

This class defines the interface that all event logging implementations must follow. Different backends can store events in different ways while providing the same API to the storage system.

Implementations

Direct Known Subclasses

Defined in:

sepia/event_logger.cr

Instance Method Summary

Instance Method Detail

abstract def append_event(object : Serializable | Container, event_type : LogEventType, generation : Int32, metadata) #

Append an event to the log.

Parameters

  • object : The Sepia object the event relates to
  • event_type : Type of event (Created, Updated, Deleted)
  • generation : Object generation number
  • metadata : Optional metadata for the event

[View source]
abstract def read_events(object_class : Class, id : String) : Array(LogEvent) #

Read all events for a specific object.

Parameters

  • object_class : The class of the object
  • id : The object's unique identifier

Returns

Array of events for the specified object, ordered by timestamp


[View source]
def should_log?(klass : Class) : Bool #

Check if this backend should log events for the given class.

Default implementation checks if the class has sepia_log_events enabled. Subclasses can override for more sophisticated filtering.

Parameters

  • klass : The class to check

Returns

True if events should be logged for this class


[View source]