David Boreham
2f53306b32
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com> Reviewed-on: #74 Co-authored-by: David Boreham <david@bozemanpass.com> Co-committed-by: David Boreham <david@bozemanpass.com>
24 lines
553 B
Bash
Executable File
24 lines
553 B
Bash
Executable File
#!/bin/sh
|
|
# Logger from this post http://www.cubicrace.com/2016/03/log-tracing-mechnism-for-shell-scripts.html
|
|
|
|
function INFO(){
|
|
local function_name="${FUNCNAME[1]}"
|
|
local msg="$1"
|
|
timeAndDate=`date`
|
|
echo "[$timeAndDate] [INFO] [${0}] $msg"
|
|
}
|
|
|
|
|
|
function DEBUG(){
|
|
local function_name="${FUNCNAME[1]}"
|
|
local msg="$1"
|
|
timeAndDate=`date`
|
|
echo "[$timeAndDate] [DEBUG] [${0}] $msg"
|
|
}
|
|
|
|
function ERROR(){
|
|
local function_name="${FUNCNAME[1]}"
|
|
local msg="$1"
|
|
timeAndDate=`date`
|
|
echo "[$timeAndDate] [ERROR] $msg"
|
|
} |