Console
Constructors
new Console()
new Console(opts): Console
Parameters
| Parameter | Type |
|---|---|
opts | ConsoleOptions |
Returns
Methods
assert()
assert(condition?, ...args?): void
Logs the formatted input if condition is falsy.
Parameters
| Parameter | Type |
|---|---|
condition? | boolean |
...args? | unknown[] |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/assert_static
clear()
clear(): void
Clears the console by printing the ANSI escape code for clearing the terminal.
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/clear_static
count()
count(label): void
Logs the number of times count() has been called with the given label.
Parameters
| Parameter | Type | Default value |
|---|---|---|
label | string | 'default' |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/count_static
countReset()
countReset(label): void
Resets the counter for the given label.
Parameters
| Parameter | Type | Default value |
|---|---|---|
label | string | 'default' |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/countReset_static
debug()
debug(...input): void
Writes the formatted input to the debug log file.
Tip
This function does not invoke text rendering mode, so it can safely be used when rendering with the Canvas API.
Parameters
| Parameter | Type |
|---|---|
...input | unknown[] |
Returns
void
dir()
dir(item?): void
Displays an interactive listing of the properties of the specified object.
Parameters
| Parameter | Type |
|---|---|
item? | unknown |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/dir_static
dirxml()
dirxml(item?): void
Alias for Console.dir.
Parameters
| Parameter | Type |
|---|---|
item? | unknown |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/dirxml_static
error()
error(...input): void
Logs the formatted input to the screen as red text.
Parameters
| Parameter | Type |
|---|---|
...input | unknown[] |
Returns
void
group()
group(...label): void
Creates a new inline group, indenting subsequent console messages.
Parameters
| Parameter | Type |
|---|---|
...label | unknown[] |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/group_static
groupCollapsed()
groupCollapsed(...label): void
Alias for Console.group.
Parameters
| Parameter | Type |
|---|---|
...label | unknown[] |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static
groupEnd()
groupEnd(): void
Exits the current inline group.
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/groupEnd_static
info()
info(...input): void
Outputs a message at the "info" log level. Alias for Console.log.
Parameters
| Parameter | Type |
|---|---|
...input | unknown[] |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/info_static
log()
log(...input): void
Logs the formatted input to the screen as white text.
Parameters
| Parameter | Type |
|---|---|
...input | unknown[] |
Returns
void
print()
print(s): void
Prints string s to the console on the screen, without any formatting applied.
A newline is not appended to the end of the string.
Parameters
| Parameter | Type | Description |
|---|---|---|
s | string | The text to print to the console. |
Returns
void
printErr()
printErr(s): void
Prints string s to the debug log file, without any formatting applied.
A newline is not appended to the end of the string.
Tip
This function does not invoke text rendering mode, so it can safely be used when rendering with the Canvas API.
Parameters
| Parameter | Type | Description |
|---|---|---|
s | string | The text to print to the log file. |
Returns
void
table()
table(data?): void
Displays tabular data as a table. Falls back to Console.log.
Parameters
| Parameter | Type |
|---|---|
data? | unknown |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/table_static
time()
time(label): void
Starts a timer with the given label.
Parameters
| Parameter | Type | Default value |
|---|---|---|
label | string | 'default' |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/time_static
timeEnd()
timeEnd(label): void
Logs the elapsed time for the given timer and removes it.
Parameters
| Parameter | Type | Default value |
|---|---|---|
label | string | 'default' |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/timeEnd_static
timeLog()
timeLog(label, ...args): void
Logs the elapsed time for the given timer without removing it.
Parameters
| Parameter | Type | Default value |
|---|---|---|
label | string | 'default' |
...args | unknown[] | undefined |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/console/timeLog_static
trace()
trace(...input): void
Logs the formatted input to the screen as white text,
including a stack trace of where the function was invoked.
Parameters
| Parameter | Type |
|---|---|
...input | unknown[] |
Returns
void
warn()
warn(...input): void
Logs the formatted input to the screen as yellow text.
Parameters
| Parameter | Type |
|---|---|
...input | unknown[] |
Returns
void