Merge pull request #10 from speed47/dev/beautifyprint

set a fixed-size prefix for logger
This commit is contained in:
Thibault Dewailly 2017-05-19 17:20:47 +02:00 committed by GitHub
commit a1f970e737

View File

@ -46,6 +46,7 @@ _logger() {
COLOR=$1 COLOR=$1
shift shift
test -z "$SCRIPT_NAME" && SCRIPT_NAME=$(basename $0) test -z "$SCRIPT_NAME" && SCRIPT_NAME=$(basename $0)
SCRIPT_NAME=$(printf "%-25.25s" "$SCRIPT_NAME")
builtin echo "$*" | /usr/bin/logger -t "[CIS_Hardening] $SCRIPT_NAME" -p "user.info" builtin echo "$*" | /usr/bin/logger -t "[CIS_Hardening] $SCRIPT_NAME" -p "user.info"
cecho $COLOR "$SCRIPT_NAME $*" cecho $COLOR "$SCRIPT_NAME $*"
} }