You can log specific moments during a user session with appropriate messages. This will allow you to later search and replay them instead of having to watch a whole session in order to find what you need.
sessionstack('log', 'sample message');
This will simply log ‘sample message’.
The provided argument is not limited to a simple String, but can be any JavaScript object. If the provided object inherits from the JavaScript Error type, SessionStack will capture the corresponding stack trace to provide you with more context when you try to figure out what went wrong.
try {
// code
} catch (e) {
sessionstack('log', e); // Will capture the stack trace from the provided error.
}
You can pass an optional configuration object:
Property Name | Type | Description |
---|---|---|
level | String | One of the following: “info” (default if none is specified) “warn” “debug” “error” |
as follows:
sessionstack('log', 'sample error message', {
level: 'error'
});