The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
This works but makes logs ugly as soon as someone write console.log("something happened" , {foo: "bar"}) as it yields something happened [object Object]
Proposed solution
Extend the config with a LogMessageSerializer which is used instead of the hard coded String(arg);.
Use current behaviour as a default StringLogMessageSerializer in the config but it could be overwritten with a e.g. JSONLogMessageSerializer that would do something like JSON.stringify(arg)
Description
Currently the
args
array for thepushLog
function maps each arg to a string.This works but makes logs ugly as soon as someone write
console.log("something happened" , {foo: "bar"})
as it yieldssomething happened [object Object]
Proposed solution
Extend the config with a
LogMessageSerializer
which is used instead of the hard codedString(arg);
.Use current behaviour as a default
StringLogMessageSerializer
in the config but it could be overwritten with a e.g.JSONLogMessageSerializer
that would do something likeJSON.stringify(arg)