develop icon indicating copy to clipboard operation
develop copied to clipboard

Document that message params can be a dictionary

Open mfb opened this issue 3 years ago • 6 comments

As far as I can tell, message params can be either a list or a dictionary of key-value pairs, but the latter is not well documented. An example might be helpful here too.

mfb avatar Sep 29 '22 19:09 mfb

@mfb is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 29 '22 19:09 vercel[bot]

This seems like it's the case as per https://develop.sentry.dev/sdk/event-payloads/types/#logentry, but not sure about all the details here.

Let me ask around.

AbhiPrasad avatar Sep 29 '22 19:09 AbhiPrasad

Ah, there is already an example of this at https://develop.sentry.dev/sdk/event-payloads/types/#logentry "JSON 2"; maybe helpful - although redundant - to copy it to this page as well...

mfb avatar Sep 29 '22 20:09 mfb

By the way, I noticed another inconsistency here re: formatted being required or optional.

mfb avatar Sep 30 '22 04:09 mfb

From the official php sdk, setMessage prototype, params is an optional string array, message a required string and formatted an optional string.

https://github.com/getsentry/sentry-php/blob/master/src/Event.php#L380

vixns avatar Sep 30 '22 07:09 vixns

At one point we wanted to soft-deprecate the non array based format which is why it's not implemented. Relay does accept it and it's fully supported, so we can re-evaluate that decision.

mitsuhiko avatar Sep 30 '22 12:09 mitsuhiko