Logger class which supports logging statistics, as well as proxy logging interfaces for extended logging.

Entries are deduplicated (repeat messages increment a count and accumulate express IDs) and buffered for displayLogs()/proxies. Additionally, the first occurrence of each distinct entry at or above the current threshold is echoed to the console sink immediately, so warnings/errors are visible live without waiting for a displayLogs() dump.

Constructors

Methods

  • Parameters

    Returns void

  • clear logs

    Returns void

  • Compresses similar logs to a single line

    Returns void

  • Create the statistics for a model ID.

    Parameters

    • modelID: number

      The model ID to create statistics for

    Returns Statistics

    The created statistics object.

  • Parameters

    • message: string

      log message

    Returns void

  • Display the deduplicated log buffer in a table.

    Gated behind the DEBUG threshold by default — a clean load should leave a quiet console (issue #301); pass force for explicit dumps (CLI -v).

    Parameters

    • force: boolean = false

      dump regardless of the current threshold

    Returns void

  • Parameters

    • message: string

      log message

    Returns void

  • Compresses the logs if they haven't been compressed, then returns a list of just the errors.

    Returns LogEntry[]

    The errors.

  • Returns LogLevel

    the current console-echo threshold

  • Returns LogEntry[]

    • list of logs
  • Parameters

    • modelID: number

    Returns undefined | Statistics

  • Parameters

    • message: string

      log message

    Returns void

  • Detects environment and initializes wasm callbacks

    Returns void

  • Is a given level at or above the current threshold?

    Parameters

    Returns boolean

    true when messages at this level echo to the console

  • Parameters

    • modelID: number

    Returns void

  • Remove a previously added proxy (no-op if absent).

    Parameters

    Returns void

  • Set the console-echo threshold. Embedders (e.g. Share) call this to quiet or expand conway's console output; the CLI maps -q/-v/-vv here.

    Parameters

    Returns void

  • Replace the console sink (e.g. the CLI routes all echoes to stderr so stdout stays parseable). Pass undefined to restore the default.

    Parameters

    • Optionalsink: LogSink

      replacement sink or undefined

    Returns void

  • Parameters

    • message: string

      log message

    Returns void