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>
revert-252-rm-only-tag-2.2.x
Drew Moseley 5 years ago
parent
commit
042bd1d3ce
  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