You can use our logger functionality for the purpose of debugging.
const client = StreamChat.getInstance('api_key', {
logger: (logLevel, message, extraData) => {
console.log(message); // or any logging tool that you are using e.g. reactotron
},
});
const client = StreamChat.getInstance(
'api_key',
'secret'
{
logger: (logLevel, message, extraData) => {
console.log(message);
}
}
)
extraData contains tags array attached to log message. Tags can have one/many of following values:
- api
- api_request
- api_response
- client
- channel
- connection
- event
It may also contains some extra data, some examples have been mentioned below:
{
"tags": ["api", "api_request", "client"],
"url": "https://chat.stream-io-api.com/channels",
"payload": { /** payload */ },
"config": { /** conig object */ }
}
{
"tags": ["api", "api_response", "client"],
"url": "https://chat.stream-io-api.com/channels",
"response": { /** object */ }
}
{
"tags": ["api", "api_response", "client"],
"url": "https://chat.stream-io-api.com/channels",
"error": { /** error object */ }
}
{
"tags": ["event", "client"],
"event": { /** event object */ }
}
{
"tags": ["channel"],
"channel": { /** channel object */ }
}