API reference@evolu/commonConsole › TestConsole

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

A test console that captures all output for assertions.

Use as a drop-in replacement for Console in tests.

Extends

Properties

child

readonly child: (name: string) => Console;

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

Creates a child console with the given name added to the path.

Child inherits the parent's configured level (not any runtime override). Use Console.children to access all children for batch operations.

Inherited from

Console.child


children

readonly children: ReadonlySet<Console>;

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

Child consoles created via Console.child.

Inherited from

Console.children


clearEntries

readonly clearEntries: () => void;

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

Clears all captured entries.

count

readonly count: (label?: string) => void;

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

Increments and logs a counter. Level: debug.

Inherited from

Console.count


countReset

readonly countReset: (label?: string) => void;

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

Resets a counter. Level: debug.

Inherited from

Console.countReset


debug

readonly debug: (...args: readonly unknown[]) => void;

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

Development diagnostics.

Inherited from

Console.debug


dir

readonly dir: (item: unknown) => void;

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

Displays an object with expandable properties. Level: debug.

Inherited from

Console.dir


error

readonly error: (...args: readonly unknown[]) => void;

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

Failures requiring immediate attention.

Inherited from

Console.error


getEntriesSnapshot

readonly getEntriesSnapshot: () => readonly ConsoleEntry[];

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

Gets all captured entries and clears the internal buffer.

getLevel

readonly getLevel: () => ConsoleLevel;

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

Returns the effective log level.

If this console has its own level set via Console.setLevel, returns that. Otherwise returns the inherited level from creation time.

Inherited from

Console.getLevel


hasOwnLevel

readonly hasOwnLevel: () => boolean;

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

Returns true if this console has its own level set (not inherited).

Inherited from

Console.hasOwnLevel


info

readonly info: (...args: readonly unknown[]) => void;

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

Operational milestones (startup, shutdown).

Inherited from

Console.info


log

readonly log: (...args: readonly unknown[]) => void;

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

General-purpose messages.

Inherited from

Console.log


name

readonly name: string;

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

Name of this console. Empty for root.

Inherited from

Console.name


setLevel

readonly setLevel: (level:
  | ConsoleLevel
  | null) => void;

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

Sets the log level for this console.

Pass a level to override the inherited level, or null to revert to the inherited level.

Inherited from

Console.setLevel


table

readonly table: (data: unknown) => void;

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

Displays tabular data. Level: debug.

Inherited from

Console.table


time

readonly time: (label: string) => void;

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

Starts a timer with the given label. Level: debug.

Inherited from

Console.time


timeEnd

readonly timeEnd: (label: string) => void;

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

Ends a timer and logs elapsed time. Level: debug.

Inherited from

Console.timeEnd


timeLog

readonly timeLog: (label: string, ...args: readonly unknown[]) => void;

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

Logs elapsed time for a timer. Level: debug.

Inherited from

Console.timeLog


trace

readonly trace: (...args: readonly unknown[]) => void;

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

Outputs a stack trace.

Inherited from

Console.trace


warn

readonly warn: (...args: readonly unknown[]) => void;

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

Recoverable issues that may need attention.

Inherited from

Console.warn


write

readonly write: (entry: ConsoleEntry) => void;

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

Writes a pre-built ConsoleEntry directly to the output, bypassing level filtering. Used to replay entries from another context (e.g., a SharedWorker) where filtering was already applied.

Inherited from

Console.write