Closed jaketodaro closed 8 years ago
@jaketodaro I like the first approach. My first thought was to add a second (optional) argument to includeTimestamp
, but I like the fact that your approach allows cleanly modifying any of the labels.
If you want to do a PR for it, go ahead. (Make sure you target develop
)
Fixed via #52
It would be nice to have the ability to customize the label for the
timestamp
field thatincludeTimestamp
automatically sets (or any other preset field). This would be useful for anyone who wants to maintain a consistent format with other logs that are being sent to loggly from non-angular sources.This could easily be supported by adding
.labels
function that accepts an object of label overrides. I'm happy to send a PR if this is approved.Alternatively, you could add support for specifying functions as fields so that users could add the timestamp themselves, but that leads to the possibility of having js errors in your logging. You could even bind the log context to the functions to give them access to some log information like the log level. Happy to send a PR for this too.