diff --git a/barnard-ui b/barnard-ui index 07e5d8d..e2fc4e3 100755 --- a/barnard-ui +++ b/barnard-ui @@ -511,11 +511,17 @@ send-logs() { manage-logs() { local action + local loggingAction while : ; do - action="$(menulist "$(gettext "Toggle session logging")" "$(gettext "Send logs with wormhole")" "$(gettext "Go Back")")" || return + if (( saveSessionLogs )); then + loggingAction="$(gettext "Disable logs")" + else + loggingAction="$(gettext "Enable logs")" + fi + action="$(menulist "$loggingAction" "$(gettext "Send logs with wormhole")" "$(gettext "Go Back")")" || return case "$action" in - "$(gettext "Toggle session logging")") toggle-session-logging ;; + "$loggingAction") toggle-session-logging ;; "$(gettext "Send logs with wormhole")") send-logs ;; "$(gettext "Go Back")"|"") return ;; esac @@ -614,6 +620,9 @@ connect() { if [[ -f "$certFile" ]] && ! config_has_nonempty_value certificate; then barnardArgs+=(-certificate "$certFile") fi + if [[ -n "$sessionLogFile" ]]; then + barnardArgs+=(-log debug -logfile "$sessionLogFile") + fi command barnard "${barnardArgs[@]}" --fifo "$configDir/cmd" --buffers 16 |& log barnardStatus=${PIPESTATUS[0]}