class Log : Component
messages: Queue

A basic FIFO (First In, First Out) queue implementation.

__new(self: Log)

Initializes a new Log component instance.

iterLast(self: Log, n: integer) iterator?: fun(): string

Returns an iterator over the last n log messages, most recent first.

Returns:

iterator? (fun(): string) – A function that returns each log message or nil when done.

staticmethod addMessage(actor: Actor, message: string)

Adds a message to an actor’s log component, if it exists.

staticmethod addMessageSensed(level: Level, action: Action, message: string)

Adds a message to all actors who sensed the source actor at the time the message was generated.