From 87dbc54044fd679f56123ffb1db9fefd35a77801 Mon Sep 17 00:00:00 2001 From: Rahul Khiyani Date: Tue, 15 Jan 2019 21:56:12 -0500 Subject: [PATCH] Adding timestamp to _shcommon as log formatter for troubleshooting Change-Id: Ie89fc95e5d7f0e4f832bac45f87915893ed79942 --- divingbell/templates/bin/_shcommon.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/divingbell/templates/bin/_shcommon.tpl b/divingbell/templates/bin/_shcommon.tpl index 36a1380..16d59df 100644 --- a/divingbell/templates/bin/_shcommon.tpl +++ b/divingbell/templates/bin/_shcommon.tpl @@ -59,7 +59,8 @@ __text_formatter(){ if [ -n "${color_prefix}" ]; then color_suffix='\e[0m' fi - echo -e "${color_prefix}${log_prefix}${1}${color_suffix}" >&${fd} + timestamp=$(date "+%m-%d-%y %H:%M:%S") + echo -e "${color_prefix}${timestamp} ${log_prefix}${1}${color_suffix}" >&${fd} } # Due to this unresolved issue: http://bit.ly/2xPmOY9 we choose preservation of # message ordering at the expense of applying appropriate tags to stderr. As a