Browse Source

Adding timestamp to _shcommon as log formatter for

troubleshooting

Change-Id: Ie89fc95e5d7f0e4f832bac45f87915893ed79942
Rahul Khiyani 3 months ago
parent
commit
87dbc54044
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      divingbell/templates/bin/_shcommon.tpl

+ 2
- 1
divingbell/templates/bin/_shcommon.tpl View File

@@ -59,7 +59,8 @@ __text_formatter(){
59 59
   if [ -n "${color_prefix}" ]; then
60 60
     color_suffix='\e[0m'
61 61
   fi
62
-  echo -e "${color_prefix}${log_prefix}${1}${color_suffix}" >&${fd}
62
+  timestamp=$(date "+%m-%d-%y %H:%M:%S")
63
+  echo -e "${color_prefix}${timestamp} ${log_prefix}${1}${color_suffix}" >&${fd}
63 64
 }
64 65
 # Due to this unresolved issue: http://bit.ly/2xPmOY9 we choose preservation of
65 66
 # message ordering at the expense of applying appropriate tags to stderr. As a

Loading…
Cancel
Save