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
|
# check if $LOG_DIR is set, if it isn’t, provide a default
|
||||||
if test -z "$LOG_DIR"; then
|
if test -z "$LOG_DIR"; then
|
||||||
LOG_DIR="$HOME/.var/log"
|
LOG_DIR="$HOME/.var/log/sway"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create log directory
|
# 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"
|
date '+%Y-%m-%dT%T %Z' >"$LOG_DIR/sway.log"
|
||||||
|
|
||||||
# count the number of previous log files
|
# count the number of previous log files
|
||||||
count=1
|
count=0
|
||||||
for file in "$LOG_DIR/sway.log.*"; do
|
for file in "$LOG_DIR"/sway.log.*; do
|
||||||
count="$(printf "%s+1\n" "$count" | bc)"
|
count="$(printf "%s+1\n" "$count" | bc)"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user