diff --git a/distr/durden b/distr/durden index ac56f4ef..ab431cea 100755 --- a/distr/durden +++ b/distr/durden @@ -16,6 +16,7 @@ fi arcan_applbase=$arcan_base/appl arcan_applout=$arcan_base/appl-out arcan_resources=$arcan_base/resources +arcan_logpath=$arcan_base/logs # a dev would've overridden this one if [ ! -d "$arcan_applbase/$applname" ]; then @@ -70,6 +71,11 @@ if [ ! -z "${XDG_VIDEOS_DIR}" ] && [ ! -d "${arcan_resources}/Videos" ]; then ln -s "${XDG_VIDEOS_DIR}" "${arcan_resources}/Videos" fi +# this is opt-in, user must make this directory himself as it can get quite verbose +if [ -d "${arcan_logpath}" ]; then + export ARCAN_LOGPATH=${1:-$arcan_logpath} +fi + # setup namespace mapping export ARCAN_APPLBASEPATH=${1:-$arcan_applbase} export ARCAN_APPLSTOREPATH=${1:-$arcan_applout} @@ -90,9 +96,17 @@ fi # snap due to the possibility of sensitive data) while true; do starttime=$(date +%s) - if arcan ${distargs} -b "$applname" "$applname" "$@"; then - exit + + if [ -d "${arcan_logpath}" ]; then + if arcan ${distargs} -b "$applname" "$applname" "$@" >"${arcan_logpath}/${applname}_${starttime}.log" 2>&1; then + exit + fi + else + if arcan ${distargs} -b "$applname" "$applname" "$@"; then + exit + fi fi + stoptime=$(date +%s) elapsed=$((stoptime - starttime)) if [ $elapsed -lt 10 ]; then