remove logging

This commit is contained in:
CanbiZ 2025-04-28 11:13:24 +02:00
parent b5e27ee280
commit 75de20858d

View File

@ -149,23 +149,23 @@ msg_error() {
stop_spinner stop_spinner
local msg="$1" local msg="$1"
printf "\r\e[2K%s %b\n" "${CROSS}" "${RD}${msg}${CL}" >&2 printf "\r\e[2K%s %b\n" "${CROSS}" "${RD}${msg}${CL}" >&2
log_message "ERROR" "$msg" #log_message "ERROR" "$msg"
} }
log_message() { # log_message() {
local level="$1" # local level="$1"
local message="$2" # local message="$2"
local timestamp # local timestamp
local logdate # local logdate
timestamp=$(date '+%Y-%m-%d %H:%M:%S') # timestamp=$(date '+%Y-%m-%d %H:%M:%S')
logdate=$(date '+%Y-%m-%d') # logdate=$(date '+%Y-%m-%d')
LOGDIR="/usr/local/community-scripts/logs" # LOGDIR="/usr/local/community-scripts/logs"
mkdir -p "$LOGDIR" # mkdir -p "$LOGDIR"
LOGFILE="${LOGDIR}/${logdate}_${NSAPP}.log" # LOGFILE="${LOGDIR}/${logdate}_${NSAPP}.log"
echo "$timestamp - $level: $message" >>"$LOGFILE" # echo "$timestamp - $level: $message" >>"$LOGFILE"
} # }
# Check if the shell is using bash # Check if the shell is using bash
shell_check() { shell_check() {
@ -1237,9 +1237,6 @@ check_container_storage() {
} }
start() { start() {
LOGDIR="/usr/local/community-scripts/logs"
mkdir -p "$LOGDIR"
if command -v pveversion >/dev/null 2>&1; then if command -v pveversion >/dev/null 2>&1; then
if ! (whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then if ! (whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
clear clear
@ -1248,9 +1245,7 @@ start() {
fi fi
SPINNER_PID="" SPINNER_PID=""
install_script install_script
fi else
if ! command -v pveversion >/dev/null 2>&1; then
CHOICE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "${APP} LXC Update/Setting" --menu \ CHOICE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "${APP} LXC Update/Setting" --menu \
"Support/Update functions for ${APP} LXC. Choose an option:" \ "Support/Update functions for ${APP} LXC. Choose an option:" \
12 60 3 \ 12 60 3 \
@ -1262,16 +1257,13 @@ start() {
1) 1)
VERB="no" VERB="no"
set_std_mode set_std_mode
log_message "INFO" "Update started (Silent Mode)"
;; ;;
2) 2)
VERB="yes" VERB="yes"
set_std_mode set_std_mode
log_message "INFO" "Update started (Verbose Mode)"
;; ;;
3) 3)
clear clear
log_message "INFO" "Update aborted."
exit_script exit_script
exit exit
;; ;;
@ -1456,9 +1448,9 @@ set_std_mode() {
# Silent execution function # Silent execution function
silent() { silent() {
if [ "$VERB" = "no" ]; then if [ "$VERB" = "no" ]; then
"$@" >>"$LOGFILE" 2>&1 "$@" >/dev/null 2>&1 || return 1
else else
"$@" 2>&1 | tee -a "$LOGFILE" "$@" || return 1
fi fi
} }