Open feinstein opened 2 years ago
Can I work on this issue?
Why not to use Expando to pass metadata with log record? I may be cumbersome, but compatible and doesn't require changing public API, it may even be implemented via extensions.
Because besides being very cumbersome, making the log code harder to read, it will also won't work of you are logging strings, since you can't expand a string.
That would be really useful to have this indeed, I'm currently implement remote logging with Google Cloud Logging for my Dart backend and I really miss a metadata attributes in order to send proper information to Cloud Logging
Many logging tools log Metadata with the traditional message, error and stack trace logs. Datadog is an example, it accepts a parameter called
attributes
, which is a json Map where you can send anything you want with your logs.Crashlytics have an
information
field that usually usesFlutterErrorDetails.informationCollector
to provide more data to the logs.My project uses this library to route all the logs from the whole app to one central location, then we distribute the logs to Crashlytics and Datadog, but since the library doesn't have a parameter for Metadata we are losing depth on our logs.
My suggestion is that we add a Metadata parameter to the
LogRecord
and thelog
functions, to enrich the logs we can generate.