]> git.proxmox.com Git - pmg-log-tracker.git/commit - src/main.rs
do not assume constant year based on file index
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 3 Jan 2022 16:09:54 +0000 (17:09 +0100)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 4 Jan 2022 12:55:49 +0000 (13:55 +0100)
commit1cdbebe57b2ddc255db240d7dbaf2165c482986d
treefd959b205e9d4a5f43a795553a1680ee77e16b96
parent6d693ce16430dbc876360383ad464b0b5b0d66ce
do not assume constant year based on file index

rather start with the current time at invocation and if the month in
the log is larger assume a year-wrap happened between logwriting and
invocation.

the old logic is flawed (but that can be said about parsing
traditional syslog timestamps (w/o year) in general) - it got worse
with the change in bullseye of rotating syslog weekly by default -
resulting in users losing one week of logs per day in the new year as
reported in https://forum.proxmox.com/threads/.102322/

Reviewed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/main.rs