Skip to main content

EventWordingUtility

Words each event a journal records the way LoggingEventListener logs it in the terminal, so a reader of a journal says what the terminal said. Imports nothing at run time, so it runs in a browser.

@example
import { EventWordingUtility } from '@quadnix/octo-event-listeners/wording';

for (const entry of journal.entries) {
for (const line of EventWordingUtility.word(entry) ?? []) {
console.log(line.level, line.text);
}
}
@group

Event Listeners/Wording

Index

Constructors

Methods

Constructors

constructor

Methods

staticword

  • The lines the terminal logs for an entry, or undefined for an event it does not log.


    Parameters

    • entry: Pick<JournalEntry, name | payload | type>

      A journal entry, or an event's name, plain payload and class name.

    • context: WordingContext = {}

      What the terminal knew beside the entry, which only these lines need.

    Returns WordedLine[] | undefined

Page Options