Logger
A custom logging handler you can provide when connecting to SketchUp.
By default the API logs to console, but you can pass your
own Logger implementation as the second argument to
SketchUpApi.connect() to route messages elsewhere — for
example, sending errors to a crash-reporting service while
silencing debug output in production.
Each method mirrors the standard console API, receiving a
message string and optional additional arguments.
Example
Section titled “Example”// A minimal logger that only shows errorslet quietLogger = { error: (msg, ...args) => console.error('[JSA]', msg, ...args), warn: () => {}, info: () => {}, debug: () => {}, log: () => {},};
await SketchUpApi.connect({}, quietLogger);Methods
Section titled “Methods”debug()
Section titled “debug()”debug(
message, …args):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
… |
|
Returns
Section titled “Returns”void
error()
Section titled “error()”error(
message, …args):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
… |
|
Returns
Section titled “Returns”void
info()
Section titled “info()”info(
message, …args):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
… |
|
Returns
Section titled “Returns”void
log(
message, …args):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
… |
|
Returns
Section titled “Returns”void
warn()
Section titled “warn()”warn(
message, …args):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
… |
|
Returns
Section titled “Returns”void