Updated log function/bash (default values) + use in update
This commit is contained in:
parent
d4b14c1d02
commit
390312ad41
|
@ -27,6 +27,14 @@ syscall(){
|
|||
# $3 - flag
|
||||
slog(){
|
||||
|
||||
echo $(date +%s)." [$2] $1" >> $LOG_DIR."/$3.log";
|
||||
test -z "$1" && msg="unknown error" || msg="$1";
|
||||
test -z "$2" && feature="main" || feature="$2";
|
||||
test -z "$3" && flag="daemon" || flag="$3";
|
||||
|
||||
test "$msg" = "-" && msg="unknown error" || msg="$1";
|
||||
test "$feature" = "-" && feature="main" || feature="$2";
|
||||
test "$flag" = "-" && flag="daemon" || flag="$3";
|
||||
|
||||
echo "$(date +%s) [$feature] $msg" >> $LOG_DIR/$flag.log;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue