Add a onLogMessage setting to BaseAPI.

This allows intercepting log messages,
for example to allow displaying them in
a user-visible interface.
This commit is contained in:
Rubén Herrero
2022-02-10 18:33:03 +01:00
parent 96337bf2fb
commit d25fabee28
10 changed files with 227 additions and 198 deletions

View File

@@ -62,6 +62,8 @@ The APIs include several settings to customize the functionality of each API:
| `xhrWithCredentials` | false | true/false | Sets the withCredentials flag on the request to the LMS |
| `xhrHeaders` | {} | Object | This allows setting of additional headers on the request to the LMS where the key should be the header name and the value is the value of the header you want to send |
| `responseHandler` | function | | A function to properly tranform the response from the LMS to the correct format. The APIs expect the result from the LMS to be in the following format (errorCode is optional): `{ "result": true, "errorCode": 0 }` |
| `onLogMessage` | function | | A function to be called whenever a message is logged. Defaults to console.{error,warn,info,debug,log} |
## Initial Values