FixAlchemy.MessageLog (FIXAlchemy v0.2.2)
View SourceA bounded record of the raw messages a session sent and received.
The log is off unless a session is started with message_log: true, and
costs nothing while off. When on, a session keeps its most recent
limit/0 messages in each direction combined, oldest discarded first, so the
memory a session can hold is fixed no matter how long it runs.
Entries are the bytes as they went on and came off the wire, with SOH intact.
Use entries/1 to read them newest first.
Summary
Functions
Discard what connection_id holds, without stopping the recording.
Stop recording for connection_id and discard what it held.
Begin recording for connection_id, discarding anything already held.
Whether connection_id is recording.
The messages held for connection_id, newest first.
How many messages a session retains.
Render an entry's bytes with SOH shown as |, for display.
Record one message for connection_id.
Types
@type direction() :: :in | :out
@type entry() :: %{ direction: direction(), raw: binary(), at: DateTime.t(), session_name: FixAlchemy.SessionConfig.name() }
Functions
@spec clear(binary()) :: :ok
Discard what connection_id holds, without stopping the recording.
@spec disable(binary()) :: :ok
Stop recording for connection_id and discard what it held.
@spec enable(binary()) :: :ok
Begin recording for connection_id, discarding anything already held.
Whether connection_id is recording.
The messages held for connection_id, newest first.
@spec limit() :: pos_integer()
How many messages a session retains.
Render an entry's bytes with SOH shown as |, for display.
@spec record(binary() | nil, direction(), binary(), FixAlchemy.SessionConfig.name()) :: :ok
Record one message for connection_id.
A no-op when the log holds nothing for the connection, which is the case unless the session enabled it.