Skip to content

logger function like dinfo turn off xtrace unless environment variable debug set #108

@coiby

Description

@coiby

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 "$-"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions