abstract const class util::Console

sys::Obj
  util::Console

@Js

Source

Console provides utilities to interact with the terminal console. For Java this API is designed to use jline if installed. In browser JavaScript environments this APIs uses the JS debugging window.

clear

abstract This clear()

Source

Clear the console of all text if supported

cur

static Console cur()

Source

Get the default console for the virtual machine

debug

abstract This debug(Obj? msg, Err? err := null)

Source

Print a message to the console at the debug level

err

abstract This err(Obj? msg, Err? err := null)

Source

Print a message to the console at the error level

group

abstract This group(Obj? msg, Bool collapsed := false)

Source

Enter an indented group level in the console. The JS debug window can specify the group to default in a collapsed state (this flag is ignored in a standard terminal).

groupEnd

abstract This groupEnd()

Source

Exit an indented, collapsable group level

height

abstract Int? height()

Source

Number of lines that fit vertically in console or null if unknown

info

abstract This info(Obj? msg, Err? err := null)

Source

Print a message to the console at the informational level

prompt

abstract Str? prompt(Str msg := "")

Source

Prompt the user to enter a string from standard input. Return null if end of stream has been reached.

promptPassword

abstract Str? promptPassword(Str msg := "")

Source

Prompt the user to enter a password string from standard input with echo disabled. Return null if end of stream has been reached.

table

abstract This table(Obj? obj)

Source

Print tabular data to the console:

  • List of list is two dimensional data where first row is header names
  • List of items with an each method will create column per key
  • List of items without each will map to a column of "val"
  • Anything else will be table of one cell table
warn

abstract This warn(Obj? msg, Err? err := null)

Source

Print a message to the console at the warning level

width

abstract Int? width()

Source

Number of chars that fit horizontally in console or null if unknown

wrap

static Console wrap(OutStream out)

Source

Construct a console that wraps an output stream. The returned console instance is not thread safe.