Scripting API
Scripting API
LogReader
Class in Abyss.Core, from Abyss.Core.
Walks the engine's log from a place of its own, reading what has been said since.
public sealed class LogReaderRemarks
Reading takes nothing away. Any number of readers walk the same log, each at its own pace — the editor's Logs panel is one, a test is another — so none of them can miss a message because another read it first.
The engine keeps a few thousand entries, and a reader that falls further behind than that finds the oldest gone. It is told how many rather than left to wonder: LogReader.Missed. One reader, one thread.
Constructors
LogReader
public LogReader()A reader from the oldest entry the engine still holds.
Which is what a log panel opened after the engine started wants: whatever Bevy said while the window was opening is still there to read.
Properties
Position
public long Position { get; private set; }The sequence number of the last entry read, or of where the reader started.
Missed
public long Missed { get; private set; }How many entries the engine let go of before this reader reached them.
Methods
FromNow
public static LogReader FromNow()A reader that sees only what is said from now on.
Read
public int Read(ICollection<LogEntry> into, int limit = 2147483647)Reads what has been said since the last read, oldest first.
Parameters
into: Where to put what was read.limit: The most to read in one go.
Returns How many were read.
