v3.5.8: feat() easier env-controlled HTTP traces. Add missing properties for asset v5 types.

This commit is contained in:
tiagosiebler
2023-05-01 12:11:09 +01:00
parent 2253329a8b
commit 70adfd646a
4 changed files with 20 additions and 7 deletions

View File

@@ -305,9 +305,11 @@ See [websocket-client.ts](./src/websocket-client.ts) for further information.
---
## Customise Logging
## Logging
Pass a custom logger which supports the log methods `silly`, `debug`, `notice`, `info`, `warning` and `error`, or override methods from the default logger as desired.
### Customise logging
Pass a custom logger (or mutate the imported DefaultLogger class) which supports the log methods `silly`, `debug`, `notice`, `info`, `warning` and `error`, or override methods from the default logger as desired, as in the example below:
```javascript
const { WebsocketClient, DefaultLogger } = require('bybit-api');
@@ -321,6 +323,10 @@ const customLogger = {
const ws = new WebsocketClient({ key: 'xxx', secret: 'yyy' }, customLogger);
```
### Debug HTTP requests
In rare situations, you may want to see the raw HTTP requets being built as well as the API response. These can be enabled by setting the `BYBITTRACE` env var to `true`.
## Browser Usage
Build a bundle using webpack: