Variable console

console: {
    debug(...input) => void;
    error(...input) => void;
    log(...input) => void;
    print(s) => void;
    printErr(s) => void;
    trace(...input) => void;
    warn(...input) => void;
} = ...

The global console object contains functions for printing text to the screen, which can be useful for text-based applications, and is also useful for debugging.

Most methods use the Switch.inspect() method for formatting, and the console.print() method to output to the screen.

NOTE: Invoking any method on the console object switches the application to text rendering mode, clearing any pixels previously drawn on the screen using the Canvas API.

Type declaration

  • debug:function
    • Writes the formatted input to the debug log file.

      Parameters

      • Rest ...input: unknown[]

      Returns void

      Note

      This function does not invoke text rendering mode, so it can safely be used when rendering with the Canvas API.

  • error:function
    • Logs the formatted input to the screen as red text.

      Parameters

      • Rest ...input: unknown[]

      Returns void

  • log:function
    • Logs the formatted input to the screen as white text.

      Parameters

      • Rest ...input: unknown[]

      Returns void

  • print:function
    • Prints string s to the console on the screen, without any formatting applied. Newline is not appending to the end of the string.

      Parameters

      • s: string

        The text to print to the console.

      Returns void

  • printErr:function
    • Prints string s to the debug log file, without any formatting applied. Newline is not appending to the end of the string.

      Parameters

      • s: string

        The text to print to the log file.

      Returns void

      Note

      This function does not invoke text rendering mode, so it can safely be used when rendering with the Canvas API.

  • trace:function
    • Logs the formatted input to the screen as white text, including a stack trace of where the function was invoked.

      Parameters

      • Rest ...input: unknown[]

      Returns void

  • warn:function
    • Logs the formatted input to the screen as yellow text.

      Parameters

      • Rest ...input: unknown[]

      Returns void

Generated using TypeDoc