From 0ee9b42d1f104decb42b24f96e7ce256dac1a6fe Mon Sep 17 00:00:00 2001 From: Mikhail Tergoev Date: Wed, 11 Jun 2025 13:51:29 +0300 Subject: [PATCH] updated debugging functions --- winehelper | 61 ++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/winehelper b/winehelper index 60a7cd5..6ee6fbf 100755 --- a/winehelper +++ b/winehelper @@ -23,14 +23,30 @@ check_variables () { [[ -z ${!1} ]] && export $1="$2" ;} ##### CHECK DEBUG ##### if [[ "$1" == "--debug" ]] ; then - export DEBUG="full" - export LOG_FILE="$HOME/winehelper.log" + check_variables WINEDEBUG "+loaddll,+seh" + export DXVK_LOG_LEVEL="error" + export VKD3D_DEBUG "error" + export WINE_MONO_TRACE "E:System.NotImplementedException" + export VK_LOADER_DEBUG "error" + export VKBASALT_LOG_LEVEL "error" + export DXVK_NVAPI_LOG_LEVEL "error" shift - print_warning "Включен режим подробного логирования работы WINE." +else + check_variables WINEDEBUG "-all" + check_variables DXVK_LOG_LEVEL "none" + check_variables VKD3D_SHADER_DEBUG "none" + check_variables VKD3D_DEBUG "none" + check_variables DXVK_LOG_PATH "none" + check_variables VKBASALT_LOG_LEVEL "none" + check_variables DXVK_NVAPI_LOG_LEVEL "none" +fi + +if [[ $WINEDEBUG != "-all" ]] ; then + export LOG_FILE="$HOME/winehelper.log" + date > "$LOG_FILE" + print_warning "Включен режим логирования работы WINE." print_warning "Лог будет сохранен по пути: $LOG_FILE" sleep 3 -else - check_variables DEBUG "0" fi ##### WINETRICKS VERSION ##### @@ -679,27 +695,6 @@ init_wine_ver () { export WINESERVER="wineserver" fi - check_variables DXVK_LOG_LEVEL "none" - check_variables VKD3D_SHADER_DEBUG "none" - check_variables VKD3D_DEBUG "none" - check_variables DXVK_LOG_PATH "none" - check_variables VKBASALT_LOG_LEVEL "none" - check_variables DXVK_NVAPI_LOG_LEVEL "none" - - if [[ $DEBUG == "0" ]] ; then - check_variables WINEDEBUG "-all" - elif [[ $DEBUG == "full" ]] ; then - check_variables WINEDEBUG "+loaddll,+seh" - export DXVK_LOG_LEVEL="error" - export VKD3D_DEBUG "error" - export WINE_MONO_TRACE "E:System.NotImplementedException" - export VK_LOADER_DEBUG "error" - export VKBASALT_LOG_LEVEL "error" - export DXVK_NVAPI_LOG_LEVEL "error" - else - check_variables WINEDEBUG "err+all" - fi - print_info "Используется версия wine: $WH_WINE_USE" } @@ -1139,13 +1134,15 @@ wine_run () { WIN_FILE_PATH="$(dirname "$WIN_FILE_EXEC")" [[ -d "$WIN_FILE_PATH" ]] && cd "$WIN_FILE_PATH" - if [[ $DEBUG == "0" ]] ; then - $MANGOHUD_RUN "$WINELOADER" "$@" $LAUNCH_PARAMETERS - else - print_var WH_WINE_USE WINEARCH WINEPREFIX WINEDLLOVERRIDES WH_WINDOWS_VER | tee "$LOG_FILE" - $MANGOHUD_RUN "$WINELOADER" "$@" $LAUNCH_PARAMETERS 2>&1 | tee -a "$LOG_FILE" - fi + if [[ -n $LOG_FILE ]] && [[ -f "$LOG_FILE" ]] ; then + echo "##### Основные переменные #####" | tee -a "$LOG_FILE" + env | grep -e "WH_" -e "WINE" -e "DXVK" -e "VKD3D" | tee -a "$LOG_FILE" + echo "##### Лог WINE #####" | tee -a "$LOG_FILE" + $MANGOHUD_RUN "$WINELOADER" "$@" $LAUNCH_PARAMETERS 2>&1 | tee -a "$LOG_FILE" + else + $MANGOHUD_RUN "$WINELOADER" "$@" $LAUNCH_PARAMETERS + fi wait_wineserver }