Skip to content

console ​

Leveled logging to stdout and stderr.

Always available

No import needed. These names are in scope in every file.

console class ​

ts
class console

console.assert ​

ts
static assert(condition: any, ...messages: any[]): void

Throw-style assertion. When condition is falsy, prints Assertion failed: followed by the space-joined messages. When truthy, the call is a no-op. Calling with zero arguments is treated as a failed assertion with no message.

console.error ​

ts
static error(...args: any[]): void

Print one space-joined line prefixed with ERROR: to stdout and capture it as an error-tagged output event.

console.info ​

ts
static info(...args: any[]): void

Print one space-joined line to stdout. Behaviourally identical to log today; reserved for informational output that hosts may route to a separate channel later.

console.log ​

ts
static log(...args: any[]): void

Print one space-joined line to stdout and capture it as an output event. The standard diagnostic entry point.

console.table ​

ts
static table(...args: any[]): void

Print a tab-separated tabular dump of the argument. Arrays of objects render as (index) plus one column per field of the first element; maps render as Key/Value pairs; instances render as Property/Value. Other inputs print their string form. Calling with zero arguments prints (empty).

console.time ​

ts
static time(label?: string): void

Start a named timer. Defaults to the label "default" when omitted. Pair with timeEnd to print the elapsed milliseconds.

console.timeEnd ​

ts
static timeEnd(label?: string): void

Stop the named timer started by time and print <label>: <ms>ms (three decimal places). Defaults to the label "default". Unknown labels are silently ignored.

console.warn ​

ts
static warn(...args: any[]): void

Print one space-joined line prefixed with WARN: to stdout and capture it as a warning-tagged output event.


Generated from lang/types/builtin_console.d.tks in the ThicketScript repository.