EventLog beta
Class of @v12-engine/engine/debug
export declare class EventLog implements TraceThe events and hooks of the last seconds of a world, the game's own among them, with the listeners and handlers that ran on them. Hooks run often (every target search asks one), so a hook is one line a tick, with how many times. Following costs a little: it is only on while attached
Members
constructor
constructor(
seconds?: number,
max?: number);Constructs a new instance of the EventLog class
attach
attach(world: World): void;Starts following a world
attached
get attached(): boolean;Whether the log is attached to a world, following what happens in it
clear
clear(): void;Empties the log and the hooks it is counting for the current tick
detach
detach(): void;Stops following it. What was logged stays
entries
get entries(): readonly LoggedEvent[];What was logged, oldest first. The same list, kept up to date: to read, not to keep
hook
hook(name: string, handlers: readonly {
id: string;
}[], own: boolean, event: unknown): void;Notes that the hook ran, with the ids of its handlers and whether it is a game's own; a hook run again in the same tick only adds to its count
listener
listener(id: string): void;Notes that the listener with this id ran on the event going out; part of Trace
max
readonly max: number;Lines kept at most, however short a time they took
seconds
readonly seconds: number;Seconds of it that are kept