Skip to content

Version 6.0 - Migrate to Time::Moment, Break API

Compare
Choose a tag to compare
@reyjrar reyjrar released this 28 Nov 01:18
v6.0

The HTTP::Date::str2time() is nice, but the Time::Moment is SO
MUCH
faster. This reworks the code to use the Time::Moment
interface. Additionally, I'm making sense out of the date handling
parameters.

I am removing support for ::DateTimeCreate from this module. This was
a terrible idea and we don't need it. If you want to use DateTime
objects in your code do:

use DateTime;
use Parse::Syslog::Line;

my $msg = parse_syslog_line(<>);
$msg{datetime_obj} = DateTime->from_epoch( epoch $msg->{epoch} );

Field Updates

  • Added datetime_utc - The ISO8601 timestamp as UTC
  • Added datetime_local - The ISO8601 timestamp in the timezone of the local server
  • Updated datetime_str - The ISO8601 timestamp in message local time
  • Deleted datetime_obj
  • Deleted date_raw

API Updates

  • TimeMomentFormatString added to control the string formatting for dates
  • DateTimeCreate is deprecated
  • HiResFmt is deprecated, use TimeMomentFormatString
  • NormalizeToUTC is deprecated, every log now returns datetime_utc
  • OutputTimeZone is deprecated, use TimeMomentFormatString

Supporting Updates

  • Documentation updates
  • Dependencies updated
  • Updates for the benchmarking tools
  • Tests updated to pass with Time::Moment

There's some issues with Time::Moment and DST. In the tests, as in
production, check datetime_utc for those cases instead of using
datetime_local or datetime_str.