Skip to content

Commit

Permalink
Add enableDebug init option reference and add it in the debug guide
Browse files Browse the repository at this point in the history
  • Loading branch information
epanholz committed Dec 18, 2024
1 parent 4f6d931 commit 9b40fd9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sites/cheerpj/src/content/docs/11-guides/cheerpj-debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ If your application passes all these checks but still isn't working correctly, y

If you do so, make sure to provide additional context, such as a HAR file and the browser's console output. This will make it easier for us to assist you. Instructions on how to generate these are provided in the following steps.

## Enable advanced debug logs in CheerpJ

Before saving the browser console output, it's important to enable advanced debug logs in CheerpJ using the [`enableDebug`] CheerpJ [`initOption`].

```js
cheerpjInit({ enableDebug: true });
```

This option enables advanced debug logging, which is helpful for troubleshooting issues with CheerpJ. It provides a lot of extra information in case an actual error occurs and will speed up the process of solving the problem you are encountering.

## Saving the browser console output

You can follow these steps to save the browser console output:
Expand Down Expand Up @@ -57,3 +67,5 @@ You can save a HAR following these steps:
[`cheerpjRunJar`]: /docs/reference/cheerpjRunJar
[`cheerpjRunMain`]: /docs/reference/cheerpjRunMain
[virtual filesystem]: /docs/guides/File-System-support
[`enableDebug`]: /docs/reference/cheerpjInit#enableDebug
[`initOption`]: docs/reference/cheerpjInit
15 changes: 15 additions & 0 deletions sites/cheerpj/src/content/docs/12-reference/00-cheerpjInit.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ async function cheerpjInit(options?: {
tailscaleIpCb?: (ip: string) => void;
licenseKey?: string;
execCallback?: function(cmdPath, argsArray) {};
enableDebug?: boolean;
}): Promise<void>;
```

Expand Down Expand Up @@ -402,6 +403,20 @@ cheerpjInit({

Learn more about the `execCallback` option in our [intercept external commands guide](/docs/guides/Intercept-external-commands).

### `enableDebug`

```ts
enableDebug?: boolean;
```

This option enables advanced debug logging, which is helpful for troubleshooting issues with CheerpJ.

Example of usage:

```js
cheerpjInit({ enableDebug: true });
```

[cjGetRuntimeResources]: /docs/reference/cjGetRuntimeResources
[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[`java`]: /docs/reference/cheerpjInit#java-mode
Expand Down

0 comments on commit 9b40fd9

Please sign in to comment.