Skip to content

Commit

Permalink
fix logging on debian (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
basejump authored Jun 23, 2022
1 parent 3794aa5 commit d6f9666
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bin/core/logit
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ __logit_exec() {
return 0 # exit fast
fi

# hack so wont fail for now on debian with no logger
if [ ! -e /dev/log ]; then
# echo "this is a log message" >> "${LOGIT_SCRIPT_LOG}"
echo "${LOGIT_FACILITY}.$1" "$2" "$3" >> "${LOGIT_SCRIPT_LOG}"
return 0 # exit fast
fi

if [[ $LOGIT_VERBOSE == true ]]; then
# The 2>&1says "redirect file descriptor #2 to the same place #1 is going", and then you can pipe both of them at once.
logger -p "${LOGIT_FACILITY}.$1" -t "$2" -s "$3" 2>&1 | tee -a "${LOGIT_SCRIPT_LOG}" 1>&2
Expand Down
2 changes: 1 addition & 1 deletion makefiles/Shipkit-main.make
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ help: | _program_awk

## list all the availible Make targets, including the targets hidden from core help
help-all:
@LC_ALL=C $(MAKE) -pRrq -f $(firstword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort -u | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
LC_ALL=C $(MAKE) -pRrq -f $(firstword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort -u | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

.PHONY: help-all

Expand Down

0 comments on commit d6f9666

Please sign in to comment.