simple logger added
This commit is contained in:
parent
ed1293c988
commit
ef9e238aa6
|
@ -15,18 +15,22 @@
|
||||||
## FUNCTIONS
|
## FUNCTIONS
|
||||||
#
|
#
|
||||||
|
|
||||||
|
addtologs() {
|
||||||
|
echo "$(date +'%Y.%m.%d-%H:%M:%S') $1" | tee -a $logs
|
||||||
|
}
|
||||||
|
|
||||||
execpause() {
|
execpause() {
|
||||||
read -p "Press [ENTER] to continue... "
|
read -p "Press [ENTER] to continue... "
|
||||||
}
|
}
|
||||||
execquite() {
|
execquite() {
|
||||||
echo "$(date +'%Y.%m.%d-%H:%M:%S') execution time is $(($(date +%s)-$time)) seconds, exit" | tee -a $logs
|
addtologs "execution time is $(($(date +%s)-$time)) seconds, exit"
|
||||||
if [ "${show}" != "qn" ];then
|
if [ "${show}" != "qn" ];then
|
||||||
execpause
|
execpause
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
execerror() {
|
execerror() {
|
||||||
echo "$(date +'%Y.%m.%d-%H:%M:%S') error: $1" | tee -a $logs
|
addtologs "error: $1"
|
||||||
execquite
|
execquite
|
||||||
}
|
}
|
||||||
getconfig() {
|
getconfig() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user