Sometimes it's helpful to have logs across disparate machines output timestamps with the same TZ offset.
Currently, the best way to do this is:
- Not do it at all, but set the
timestamp_fmt string to something like %FT%T%z, a proper ISO8601 with TZ offset (%z).
- Change the default TZ of the R session (either from within R or prior to launching the R process from the shell; the latter approach is somewhat error-prone and dependent on how different OSes and Linux distros manage timezones).
But(!), base::format.POSIXct includes a tz parameter; here's the signature:
format.POSIXct <- function(x, format = "", tz = "", usetz = FALSE, ...)
... and lgr's default Layouts simply delegate to that function.
I wonder if it'd be possible to pass on the tz argument, or perhaps even more generally simply 'pass the dots' and allow timestamp_tz setters to specify a dots (...) arg that is captured, stored, then spliced into the eventual format.POSIXct dispatch.
Only a suggestion :-) ... and thanks much for all the work you've put into lgr, it's quite nice!
Sometimes it's helpful to have logs across disparate machines output timestamps with the same TZ offset.
Currently, the best way to do this is:
timestamp_fmtstring to something like%FT%T%z, a proper ISO8601 with TZ offset (%z).But(!),
base::format.POSIXctincludes atzparameter; here's the signature:... and lgr's default Layouts simply delegate to that function.
I wonder if it'd be possible to pass on the
tzargument, or perhaps even more generally simply 'pass the dots' and allowtimestamp_tzsetters to specify a dots (...) arg that is captured, stored, then spliced into the eventualformat.POSIXctdispatch.Only a suggestion :-) ... and thanks much for all the work you've put into lgr, it's quite nice!