fixed logging
This commit is contained in:
parent
281f52932e
commit
a16a15e7a2
@ -11,7 +11,7 @@ set -e
|
||||
|
||||
# check if $LOG_DIR is set, if it isn’t, provide a default
|
||||
if test -z "$LOG_DIR"; then
|
||||
LOG_DIR="$HOME/.var/log"
|
||||
LOG_DIR="$HOME/.var/log/sway"
|
||||
fi
|
||||
|
||||
# create log directory
|
||||
@ -24,8 +24,8 @@ mv "$LOG_DIR/sway.log" "$LOG_DIR/sway.log.latest"
|
||||
date '+%Y-%m-%dT%T %Z' >"$LOG_DIR/sway.log"
|
||||
|
||||
# count the number of previous log files
|
||||
count=1
|
||||
for file in "$LOG_DIR/sway.log.*"; do
|
||||
count=0
|
||||
for file in "$LOG_DIR"/sway.log.*; do
|
||||
count="$(printf "%s+1\n" "$count" | bc)"
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user