Mac-Nerd / patchomator

Management script for Installomator.
Apache License 2.0
106 stars 9 forks source link

Create Logging #19

Closed michael-zukrow-da closed 7 months ago

michael-zukrow-da commented 7 months ago

Would like the ability to run extension attributes/automation based around last run date/success

since Installomator uses "log_location="/private/var/log/Installomator.log"" for logging I would suggest a similar format/location

obviously could include various levels of logging but the hoped for format is

log_location="/private/var/log/Patchomator.log" FinishTime=$(date '+%F %H:%M:%S')

if [[ $installmode ]] then

IFS=' '

queuedLabelsArray=("${(@s/ /)labelsArray}") 
numLabels=$((${#queuedLabelsArray[@]} - 1))

if [[ $numLabels > 0 ]]
then
    infoOut "Passing $numLabels labels to Installomator: $queuedLabelsArray"
    doInstallations
else
    infoOut "All apps up to date. Nothing to do." # inbox zero
    #new line here 
    echo '${FinishTime} success" | tee -a log_location
fi

exit 0

fi

end install mode

if [ "$errorCount" -gt 0 ] then

modified line here

echo "${FinishTime} fail ${BOLD}Completed with $errorCount errors.${RESET}\n" | tee -a log_location

else echo "${BOLD}Done.${RESET}\n" fi

displayConfig

Mac-Nerd commented 7 months ago

logging added in 1.1.RC3