This is a set of scripts, along with a LaunchAgent and a LaunchDaemon, that tracks when users login and logout of a macOS systtem, as well as when the system starts up or shuts down.
Short answer: last
is probably fine in most cases.
Long answer: last
is three versions out of date, and all the other options are worse.