changed message to local val msg
This commit is contained in:
parent
05a9822361
commit
19721380b5
@ -25,13 +25,14 @@ log() {
|
|||||||
if [ -f "$log_file" ]; then
|
if [ -f "$log_file" ]; then
|
||||||
touch $log_file
|
touch $log_file
|
||||||
fi
|
fi
|
||||||
if [ $(wc -l < $log_file) > 100000 ]; then
|
|
||||||
|
if [[ "$(wc -l < $log_file)" > "100000" ]]; then
|
||||||
# remove first line
|
# remove first line
|
||||||
sed -e 1d -i $log_file
|
sed -e 1d -i $log_file
|
||||||
fi
|
fi
|
||||||
message="$(date +'%D_%T'): $*"
|
local msg="$(date +'%Y-%m-%d_%T'): $*"
|
||||||
printf "$message\n" >&2
|
printf "$msg\n" >&2
|
||||||
printf "$message\n" >> $log_file
|
printf "$msg\n" >> $log_file
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug() {
|
log_debug() {
|
||||||
|
Loading…
Reference in New Issue
Block a user