Log only when running from a terminal
This commit is contained in:
parent
eac91c85e5
commit
33a2138255
1 changed files with 7 additions and 2 deletions
|
@ -27,7 +27,10 @@ readonly LOGFILE="${HOME}/spam-ham-learn.log"
|
||||||
|
|
||||||
log()
|
log()
|
||||||
{
|
{
|
||||||
printf "I: %s\n" "$*" >> "${LOGFILE}"
|
if [ -t 1 ]; then
|
||||||
|
# Only print things if running from a terminal.
|
||||||
|
printf "I: %s\n" "$*"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
learn_spam()
|
learn_spam()
|
||||||
|
@ -37,8 +40,10 @@ learn_spam()
|
||||||
log "Entering learn_spam"
|
log "Entering learn_spam"
|
||||||
|
|
||||||
if [ "${FORCE}" = "false" ]; then
|
if [ "${FORCE}" = "false" ]; then
|
||||||
log "--force detected; not using -ctime on find"
|
log "--force not detected; using -ctime on find"
|
||||||
findargs=" -ctime +${SPAM_MIN_AGE} "
|
findargs=" -ctime +${SPAM_MIN_AGE} "
|
||||||
|
else
|
||||||
|
log "--force detected; not using -ctime on find"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collecting the spam.
|
# Collecting the spam.
|
||||||
|
|
Loading…
Reference in a new issue