API reference@evolu/commonConsole › TestConsole

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

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:112

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:85

Child consoles created via Console.child.

Inherited from

Console.children


clearEntries

readonly clearEntries: () => void;

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

Clears all captured entries.

count

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

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

Increments and logs a counter. Level: debug.

Inherited from

Console.count


countReset

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

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

Resets a counter. Level: debug.

Inherited from

Console.countReset


debug

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

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

Development diagnostics.

Inherited from

Console.debug


dir

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

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

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:130

Failures requiring immediate attention.

Inherited from

Console.error


getEntriesSnapshot

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

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

Gets all captured entries and clears the internal buffer.

getLevel

readonly getLevel: () => ConsoleLevel;

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

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:104

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:124

Operational milestones (startup, shutdown).

Inherited from

Console.info


log

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

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

General-purpose messages.

Inherited from

Console.log


name

readonly name: string;

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

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:101

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:136

Displays tabular data. Level: debug.

Inherited from

Console.table


time

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

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

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:145

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:142

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:115

Outputs a stack trace.

Inherited from

Console.trace


warn

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

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

Recoverable issues that may need attention.

Inherited from

Console.warn


write

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

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

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