Skip to content

Commit b603b0b

Browse files
committed
Don't let logger functions turn off xtrace
Resolves: #108 Functions like dwarn in kdump-logger.sh disable xtrace temporarily and only re-enable xtrace when debug is set. Automatically set debug environment variable to resolve this issue. Signed-off-by: Coiby Xu <coxu@redhat.com>
1 parent a6c10e5 commit b603b0b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kdump-logger.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
# The code in this file might be run in an environment without bash.
3838
# Any code added must be POSIX compliant.
3939

40+
# When xtrace is enabled, set debug to prevent logger functions from turning
41+
# off xtrace
42+
[ "$-" == *"x"* ] && debug=1
43+
4044
# Define vairables for the log levels in this module.
4145
kdump_stdloglvl=""
4246
kdump_sysloglvl=""

0 commit comments

Comments
 (0)