Add guide to enable debug logs (#32)

This commit is contained in:
Franck R 2022-01-31 10:56:57 +11:00 committed by GitHub
parent b8e0400a02
commit f2e22d0cd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,47 @@
---
title: How to Debug your Waku dApp
date: 2022-01-31T00:00:00+01:00
weight: 9
---
# How to Debug your Waku dApp
JS-Waku and its most relevant dependencies (libp2p) uses [debug](https://www.npmjs.com/package/debug) to handle logs.
## NodeJS
To enable debug logs when running js-waku with NodeJS, simply set the `DEBUG` environment variable.
To only enable js-waku debug logs:
```shell
export DEBUG=waku*
```
To enable js-waku and libp2p debug logs:
```sh
export DEBUG=waku*,libp2p*
```
To enable **all** debug logs:
```sh
export DEBUG=*
```
## Browser
To see the debug logs in your browser's console, you need to modify the local storage and add `debug` key.
Here are guides for some modern browsers:
- [Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector/Local_Storage_Session_Storage)
- [Chrome](https://developer.chrome.com/docs/devtools/storage/localstorage/)
| key | value | effect |
|---------|-----------------|--------------------------------------|
| `debug` | `waku*` | enable js-waku debug logs |
| `debug` | `waku*,libp2p*` | enable js-waku and libp2p debug logs |
| `debug` | `*` | enable **all** debug logs |

View File

@ -4,9 +4,10 @@ weight: 30
# Guides # Guides
## Waku Concepts ## General Concepts
- [How to Choose a Content Topic](./01_choose_content_topic/) - [How to Choose a Content Topic](./01_choose_content_topic/)
- [How to Debug your Waku dApp](./09_debug/)
## JavaScript ## JavaScript