rocicorp / reflect-draw

https://reflect-draw.vercel.app
Other
17 stars 3 forks source link

chore: Improve the data dog logger for non strings #82

Closed arv closed 1 year ago

arv commented 1 year ago

Previously we did a toString on all the arguments passed into log.

The DataDog API says the message should be a string but any value works and its JSON representation is what gets sent to the server.

By passing an array of objects we get a nicer more detailed log message in DataDog.

But... Errors get included as {} because JSON.stringify(new Error()) returns "{}". We therefore do the same dance we do in reflect-server to improve how errors are logged.

Towards https://github.com/rocicorp/mono/issues/203

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
replidraw-do ✅ Ready (Inspect) Visit Preview Jan 11, 2023 at 4:15PM (UTC)
grgbkr commented 1 year ago

LGTM