From a2eb7f66e4a6149e85e95222771d9edf43570cb7 Mon Sep 17 00:00:00 2001 From: Jimmy Maple <38733055+jimmyatSplunk@users.noreply.github.com> Date: Sun, 12 Apr 2020 23:59:58 -0400 Subject: [PATCH] fix(messages): Fix to set proper component logging Fixed issue where messages from different actions weren't logging correctly due to using the wrong variable in when crafting the log message --- lgsm/functions/core_messages.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index da90ebc43..386ff1c7c 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -47,7 +47,7 @@ fn_sleep_time(){ fn_script_log(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandaction}: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" fi @@ -59,7 +59,7 @@ fn_script_log_pass(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandaction}: PASS: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" fi @@ -83,7 +83,7 @@ fn_script_log_fatal(){ fn_script_log_error(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandaction}: ERROR: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" fi @@ -95,7 +95,7 @@ fn_script_log_error(){ fn_script_log_warn(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandaction}: WARN: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" fi @@ -107,7 +107,7 @@ fn_script_log_warn(){ fn_script_log_info(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandaction}: INFO: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" fi