Closed
Description
Problem Statement
https://twitter.com/branmcconnell/status/1612828176102883331
Sentry has a Message Interface, which is contained in the logentry
field. This allows us to store a paramaterized representation of the message, which helps with grouping and other product features.
We should expose a helper function, that will set the logentry field when captured by captureMessage
.
Solution Brainstorm
function parametrize(strings, ...values) {
let formatted = new String(String.raw(strings, ...values));
formatted.__sentry_template_string__ = strings.join("\x00").replace(/%/g, "%%").replace(/\x00/g, "%s");
formatted.__sentry_template_values__ = values;
return formatted;
}
The paramaterize function is a tag template.
The __sentry_template_string__
can then be consumed by client processing to set a logentry
on `captureMessage.
Sentry.captureMessage(parametrize`This is a log statement with ${x} and ${y} params`)
Metadata
Metadata
Assignees
Type
Projects
Status
No status
Status
Waiting for: Product Owner