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"
|
|
} |