logger functions like dinfo will disable xtrace unexpectedly,
ddebug()
{
set +x
dlog 4 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
dinfo()
{
set +x
dlog 3 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
As a result, bash -x kdumpctl or shellspec -x may show incomplete xtrace. I'm not sure if we should re-enable xtrace automatically if we detect x in "$-"