Skip to content

Commit 7bf4668

Browse files
committed
improved logging function
1 parent 4f14d41 commit 7bf4668

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

func/shared.func

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ log_event() {
66

77
# Checking logging system
88
if [ "$LOG_SYSTEM" = 'yes' ]; then
9-
# Checking logging level
10-
log=$(echo "$LOG_LEVEL" | cut -f 2 -d \' | grep -w "$level" )
11-
if [ ! -z "$log" ]; then
9+
log=$(echo "$LOG_LEVEL" | grep -w "$level" )
10+
if [ -n "$log" ]; then
1211
echo "$event" >> $V_LOG/$level.log
1312
fi
1413
fi
@@ -27,7 +26,6 @@ log_history() {
2726

2827
# Argument list checker
2928
check_args() {
30-
3129
sys_args="$1"
3230
user_args="$2"
3331
usage="$3"
@@ -368,9 +366,9 @@ is_system_enabled() {
368366
}
369367

370368
proxy_function() {
371-
if [ "$PROXY_SYSTEM" != 'nginx' ]; then # only nginx
372-
echo "Error: proxy hosting support disabled" # support for
373-
log_event 'debug' "$E_DISABLED $V_EVENT" # now
369+
if [ "$PROXY_SYSTEM" != 'nginx' ]; then
370+
echo "Error: proxy hosting support disabled"
371+
log_event 'debug' "$E_DISABLED $V_EVENT"
374372
exit $E_DISABLED
375373
fi
376374
}

0 commit comments

Comments
 (0)