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.
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...
Error
s get included as{}
becauseJSON.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