API reference@evolu/commonConsole › ConsoleStoreOutput

Defined in: packages/common/src/Console.ts:320

A ConsoleOutput that stores the latest entry in a ReadonlyStore.

Subscribe to ConsoleStoreOutput.entry to observe all log entries.

Example

const storeOutput = createConsoleStoreOutput();
const console = createConsole({ output: storeOutput });

storeOutput.entry.subscribe(() => {
  const entry = storeOutput.entry.get();
  if (entry) forwardToClient(entry);
});

Extends

Properties

entry

readonly entry: ReadonlyStore<
  | ConsoleEntry
| null>;

Defined in: packages/common/src/Console.ts:322

Latest entry written to this output.


write

readonly write: (entry: ConsoleEntry, formatter?: ConsoleFormatter) => void;

Defined in: packages/common/src/Console.ts:236

Write a log entry to this output.

Inherited from

ConsoleOutput.write