mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Extra space to align log output
This commit is contained in:
@@ -98,13 +98,20 @@ printlog(){
|
||||
done <<< "$log_message"
|
||||
fi
|
||||
|
||||
# Extra spaces
|
||||
space_char=""
|
||||
if [[ ${#log_priority} -eq 3 ]]; then
|
||||
space_char=" "
|
||||
elif [[ ${#log_priority} -eq 4 ]]; then
|
||||
space_char=" "
|
||||
fi
|
||||
# If our logging level is greaterthan or equal to our set level then output locally.
|
||||
if [[ ${levels[$log_priority]} -ge ${levels[$LOGGING]} ]]; then
|
||||
while IFS= read -r logmessage; do
|
||||
if [[ "$(whoami)" == "root" ]]; then
|
||||
echo "$timestamp" : "${log_priority} : $label : ${logmessage}" | tee -a $log_location
|
||||
echo "$timestamp" : "${log_priority}${space_char} : $label : ${logmessage}" | tee -a $log_location
|
||||
else
|
||||
echo "$timestamp" : "${log_priority} : $label : ${logmessage}"
|
||||
echo "$timestamp" : "${log_priority}${space_char} : $label : ${logmessage}"
|
||||
fi
|
||||
done <<< "$log_message"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user