From 213f8594c0ca2f6db69880d3e6098e5155d6a89e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 28 Oct 2015 13:19:38 -0400 Subject: log_*(): Don't overwrite log file with each message --- diff --git a/src/log.sh b/src/log.sh index 03fbe5e..73632cf 100644 --- a/src/log.sh +++ b/src/log.sh @@ -23,6 +23,7 @@ log_init() shift 1 log_file="${file}" + >"${log_file}" return 0 } @@ -33,7 +34,7 @@ log_dbg() shift 1 if [ "x${log_file}" != 'x' ]; then - printf "Debug: ${fmt}\n" "${@}" >"${log_file}" + printf "Debug: ${fmt}\n" "${@}" >>"${log_file}" fi return 0 @@ -45,7 +46,7 @@ log_info() shift 1 if [ "x${log_file}" != 'x' ]; then - printf "${fmt}\n" "${@}" >"${log_file}" + printf "${fmt}\n" "${@}" >>"${log_file}" fi return 0 @@ -57,7 +58,7 @@ log_warn() shift 1 if [ "x${log_file}" != 'x' ]; then - printf "Warning: ${fmt}\n" "${@}" >"${log_file}" + printf "Warning: ${fmt}\n" "${@}" >>"${log_file}" fi return 0 @@ -69,7 +70,7 @@ log_err() shift 1 if [ "x${log_file}" != 'x' ]; then - printf "Error: ${fmt}\n" "${@}" >"${log_file}" + printf "Error: ${fmt}\n" "${@}" >>"${log_file}" fi return 0 -- cgit v0.9.1