Browse Source

Fix missed log messages.

Currently this is redirecting stdout to stderr and then writing the
now blank stdout to the log file.  This results in log messages getting
displayed to the screen but missed in the log file.

Changelog: Title
Signed-off-by: Drew Moseley <drew.moseley@northern.tech>
(cherry picked from commit 042bd1d3ce)
2.1.x
Drew Moseley 4 years ago
committed by Kristian Amlie
parent
commit
980c951b37
No known key found for this signature in database GPG Key ID: F464407C996AF03F
  1. 3
      modules/log.sh

3
modules/log.sh

@ -32,7 +32,8 @@ function log {
local -r message="$2"
local -r timestamp=$(date +"%Y-%m-%d %H:%M:%S")
local -r script_name="$(basename "$0")"
>&2 echo -e "${timestamp} [${level}] [$script_name] ${message}" | tee -a ${log_file}
echo -e "${timestamp} [${level}] [$script_name] ${message}" >> ${log_file}
>&2 echo -e "${timestamp} [${level}] [$script_name] ${message}"
}
function local_log_debug {

Loading…
Cancel
Save