Skip to content

Commit 956c13f

Browse files
authored
core: remove unneeded logging (#4103)
* core: remove unneeded logging caused sometimes in issues with alpine scripts * make whiptail bigger
1 parent 3aee310 commit 956c13f

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

misc/build.func

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,6 @@ msg_error() {
149149
stop_spinner
150150
local msg="$1"
151151
printf "\r\e[2K%s %b\n" "${CROSS}" "${RD}${msg}${CL}" >&2
152-
log_message "ERROR" "$msg"
153-
}
154-
155-
log_message() {
156-
local level="$1"
157-
local message="$2"
158-
local timestamp
159-
local logdate
160-
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
161-
logdate=$(date '+%Y-%m-%d')
162-
163-
LOGDIR="/usr/local/community-scripts/logs"
164-
mkdir -p "$LOGDIR"
165-
166-
LOGFILE="${LOGDIR}/${logdate}_${NSAPP}.log"
167-
echo "$timestamp - $level: $message" >>"$LOGFILE"
168152
}
169153

170154
# Check if the shell is using bash
@@ -1120,7 +1104,7 @@ install_script() {
11201104
while true; do
11211105

11221106
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \
1123-
14 50 5 \
1107+
18 60 6 \
11241108
"1" "Default Settings" \
11251109
"2" "Default Settings (with verbose)" \
11261110
"3" "Advanced Settings" \
@@ -1238,9 +1222,6 @@ check_container_storage() {
12381222

12391223
start() {
12401224
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
1241-
LOGDIR="/usr/local/community-scripts/logs"
1242-
mkdir -p "$LOGDIR"
1243-
12441225
if command -v pveversion >/dev/null 2>&1; then
12451226
if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
12461227
clear
@@ -1263,16 +1244,13 @@ start() {
12631244
1)
12641245
VERB="no"
12651246
set_std_mode
1266-
log_message "INFO" "Update started (Silent Mode)"
12671247
;;
12681248
2)
12691249
VERB="yes"
12701250
set_std_mode
1271-
log_message "INFO" "Update started (Verbose Mode)"
12721251
;;
12731252
3)
12741253
clear
1275-
log_message "INFO" "Update aborted."
12761254
exit_script
12771255
exit
12781256
;;
@@ -1457,9 +1435,9 @@ set_std_mode() {
14571435
# Silent execution function
14581436
silent() {
14591437
if [ "$VERB" = "no" ]; then
1460-
"$@" >>"$LOGFILE" 2>&1
1438+
"$@" >/dev/null 2>&1 || return 1
14611439
else
1462-
"$@" 2>&1 | tee -a "$LOGFILE"
1440+
"$@" || return 1
14631441
fi
14641442
}
14651443

0 commit comments

Comments
 (0)