sdp_log_event: don't echo the human-log mirror to stdout with no LOGFILE
The run_if_{master,edge,replica,broker,proxy}.sh wrapper family
deliberately never sets LOGFILE (they share one .jsonl keyed by script
name instead of a *.log sibling). sdp_log_event's convenience mirror
into the human-readable log via log() assumed a LOGFILE was always
set; log()'s own fallback behavior with none is to echo to stdout -
exactly the "never write to stdout" invariant this module documents at
its own header, silently violated on every single cron run through any
of those five wrappers, success or failure.
Confirmed live: a cron email from run_if_master.sh (subject line naming
the wrapped command, body "... sdp_event script=run_if_master.sh
status=success exit_code=0 duration=0.406s") landed on every run, not
just failures - cron mails on any stdout output regardless of exit
code, and this fired on 100% of runs since it was never gated on
LOGFILE actually being set.
Fix: only call log() when LOGFILE is non-empty. Verified both ways:
run_if_master.sh's case (no LOGFILE) is now completely silent on a
successful run; daily_checkpoint.sh's case (LOGFILE set) still gets
the sdp_event line mirrored into checkpoint.log exactly as before -
no regression to the intended behavior for scripts that do have a log
file.