Structured log entry store for the GUI Messages tab.
Holds up to 1000 structured log entries with level, subsystem, timestamp, text, and optional file path. The GUI protocol encoder reads from this store to send incremental entries to the frontend.
The TUI uses the *Messages* gap buffer, written by MessagesBuffer.
Both are fed from :log_message event broadcasts via Minga.Log.
Summary
Functions
Append a structured log entry. Trims to 1000 entries.
Ensures a raw struct has a producer-assigned restart instance.
Returns entries with id > since_id (for incremental protocol sends).
Level byte for protocol encoding.
Mark the last sent ID (called after protocol encode).
Merges the producer's sent cursor without replacing newer entries.
Creates a message stream with a producer-assigned restart instance.
Parse level and subsystem from a log message text prefix.
Resets the consumer send cursor after frontend state is lost.
Subsystem byte for protocol encoding.
Types
@type level() :: :debug | :info | :warning | :error
@type stream_instance() :: 1..4_294_967_295
@type subsystem() :: :editor | :lsp | :parser | :git | :render | :agent | :zig | :gui
@type t() :: %MingaEditor.UI.Panel.MessageStore{ entries: [MingaEditor.UI.Panel.MessageStore.Entry.t()], last_sent_id: non_neg_integer(), next_id: pos_integer(), stream_instance: 0 | stream_instance() }
Functions
Append a structured log entry. Trims to 1000 entries.
Ensures a raw struct has a producer-assigned restart instance.
@spec entries_since(t(), non_neg_integer()) :: [ MingaEditor.UI.Panel.MessageStore.Entry.t() ]
Returns entries with id > since_id (for incremental protocol sends).
@spec level_byte(level()) :: non_neg_integer()
Level byte for protocol encoding.
@spec mark_sent(t(), non_neg_integer()) :: t()
Mark the last sent ID (called after protocol encode).
Merges the producer's sent cursor without replacing newer entries.
@spec new() :: t()
Creates a message stream with a producer-assigned restart instance.
Parse level and subsystem from a log message text prefix.
Resets the consumer send cursor after frontend state is lost.
@spec subsystem_byte(subsystem()) :: non_neg_integer()
Subsystem byte for protocol encoding.