Console API
Provides output redirection for info, warning, and error messages to the foobar2000 system console.
console
console.error
Write an error line to the foobar2000 console, prefixed with [WebView][ERROR].
| Parameter | Type | Required | Description |
|---|---|---|---|
message | any | No | What to write. A string is written as it is; any other JSON value as its JSON text. Takes precedence over args. |
args | any[] | No | Values to write, separated by spaces: strings as they are, other values as their JSON text. Used only when message is absent. |
Returns
success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.
Provide one of message or args; a call with neither fails with INVALID_PARAMS (message is required).
const result = await fb2k.invoke('console.error', { message: 'failed to load artwork' });console.log
Write a line to the foobar2000 console, prefixed with [WebView].
| Parameter | Type | Required | Description |
|---|---|---|---|
message | any | No | What to write. A string is written as it is; any other JSON value as its JSON text. Takes precedence over args. |
args | any[] | No | Values to write, separated by spaces: strings as they are, other values as their JSON text. Used only when message is absent. |
Returns
success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.
Provide one of message or args; a call with neither fails with INVALID_PARAMS (message is required).
const result = await fb2k.invoke('console.log', { message: 'track started' });console.warn
Write a warning line to the foobar2000 console, prefixed with [WebView][WARN].
| Parameter | Type | Required | Description |
|---|---|---|---|
message | any | No | What to write. A string is written as it is; any other JSON value as its JSON text. Takes precedence over args. |
args | any[] | No | Values to write, separated by spaces: strings as they are, other values as their JSON text. Used only when message is absent. |
Returns
success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.
Provide one of message or args; a call with neither fails with INVALID_PARAMS (message is required).
const result = await fb2k.invoke('console.warn', { args: ['retry', 3] });Owner-family behavior and limits
console.log,console.warnandconsole.errorshare theirmessage/argsrule withlog.write; see Log API.