Skip to content

Commit cfdfcc3

Browse files
committed
feat: dev-debug.log moved to /data/log if running in docker
1 parent 35a535b commit cfdfcc3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lgsm/modules/core_exit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ fn_exit_dev_debug() {
1313
echo -e "${moduleselfname} exiting with code: ${exitcode}"
1414
if [ -f "${rootdir}/dev-debug.log" ]; then
1515
grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log"
16+
elif [ -f "${lgsmlogdir}/dev-debug.log" ]; then
17+
grep -a "modulefile=" "${lgsmlogdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log"
1618
fi
1719
fi
1820
}

linuxgsm.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
# Debugging
1717
if [ -f ".dev-debug" ]; then
18-
exec 5> dev-debug.log
18+
if [ -f /.dockerenv ]; then
19+
exec 5> /data/log/dev-debug.log
20+
else
21+
exec 5> dev-debug.log
22+
fi
1923
BASH_XTRACEFD="5"
2024
set -x
2125
fi

0 commit comments

Comments
 (0)