fix(logger): Perform cmd subst outside heredoc

Perform function and command value substitution outside the heredoc forwarded to logger for JournalD entries.
This commit is contained in:
2026-07-23 00:17:42 -06:00
parent ec75cffbf1
commit d9aa8973a3
+13 -8
View File
@@ -107,16 +107,21 @@ writeJournalDLog() {
return
fi
J_TIMESTAMP="$(getTimeStamp)"
J_PID="$$"
J_PRIO="$(translateLogLevelsToJournalD "$2")"
J_STAT="$(uppercase "$3")"
logger --journald <<end
SYSLOG_TIMESTAMP="$(getTimeStamp)"
SYSLOG_TIMESTAMP=${J_TIMESTAMP}
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER="${LOG_PROGRAM_NAME}"
SYSLOG_PID="$$"
PRIORITY="$(translateLogLevelsToJournalD "$2")"
STATUS="$(uppercase "$3")"
MESSAGE="$1"
OPERATION="${4:-UNSPECIFIED}"
ERRNO="${5:-999}"
SYSLOG_IDENTIFIER=${LOG_PROGRAM_NAME}
SYSLOG_PID=${J_PID}
PRIORITY=${J_PRIO}
STATUS=${J_STAT}
MESSAGE=$1
OPERATION=${4:-UNSPECIFIED}
ERRNO=${5:-999}
end
return