committed this change
Fixed bug where detection of journal number fails for new/empty data
Removed msg() and bail() functions, and changed approach to make the
existing log() and die() functions behave correctly regardless of
whether $LOGFILE is defined.
If $LOGFILE is defined, log() silently write to the log file, otherwise
writes to the screen (stdout).
If $LOGFILE is defined, die() writes to the log file and sends an
email, otherwise writes to the screen (stdout). If on a tty, error
is duplicated in stderr.
To Do: Improve in-code comments.
Bypassing pre-commit review until tests pass.
to cycle through the changes.