Skip to content
Classloggerv0.4.4

LoggerUtilities

Logging helpers for lists, summaries, registration lines, and blocks.

class LoggerUtilities

Member visibility

Filter class members by access level.

constructor

Constructs a new instance of the LoggerUtilities class

LoggerUtilities(logger: ILogger)

block()

Logs a heading and its lines as one record so the TUI renders them as a single block. styleHeading replaces the default mint bold, pass an identity function for a heading that styles its own spans.

public block(
    heading: string,
    lines: readonly string[],
    level?: LogLevel,
    styleHeading?: (heading: string) => string
): void

counts()

Formats non-zero counts into N label chips, wrapped onto lines under maxWidth.

public counts(
    record: Record<string, number>,
    maxWidth?: number
): string[]

entries()

Formats name path block lines, names padded to a column and paths relative and dimmed.

public entries(
    items: readonly { name: string; from: string }[]
): string[]

initialization()

Logs component initialization start or end.

public initialization(
    component: string,
    action: "start" | "end",
    level?: LogLevel
): void

item()

Logs a single item with an arrow prefix.

public item(
    text: string,
    level?: LogLevel
): void

list()

Logs a list of items with an optional heading above them.

public list(
    items: string[],
    heading?: string,
    level?: LogLevel
): void

progress()

Logs progress as "[current/total]" with an optional item label.

public progress(
    current: number,
    total: number,
    item?: string,
    level?: LogLevel
): void

registration()

Logs a component registration line, with an optional type label like 'middleware' or 'handler'.

public registration(
    name: string,
    from: string,
    type?: string,
    level?: LogLevel
): void

wrap()

Packs labels into ·-separated lines under maxWidth, each styled.

public wrap(
    labels: readonly string[],
    maxWidth?: number
): string[]