Add support for DEBUG flag

This commit is contained in:
David Coppit
2015-06-27 13:30:15 -04:00
parent 33c19314b3
commit 99f51ecc05
2 changed files with 8 additions and 3 deletions

View File

@@ -202,12 +202,14 @@ while true
do
if read RECORD
then
if [[ "$DEBUG" == "1" ]]
then
echo "$(ts) [DEBUG] $RECORD"
fi
EVENT=$(echo "$RECORD" | cut -d' ' -f 1)
FILE=$(echo "$RECORD" | cut -d' ' -f 2-)
# echo "EVENT=$EVENT"
# echo "FILE=$FILE"
if ! is_change_event "$EVENT" "$FILE"
then
continue

View File

@@ -38,3 +38,6 @@ UMASK=0
# most programs don't worry about checking the current state before making a change. e.g. chmod will set the mode of a
# file even if it already has that mode.
IGNORE_EVENTS_WHILE_COMMAND_IS_RUNNING=1
# Set this to 1 to log all events, for debugging purposes. WARNING! This creates copious amounts of confusing logging!
DEBUG_EVENTS=0