mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: tweak qltest logs
* verbosity is raised to DEBUG to have more information in the logs * color codes are now skipped in the `qltest.log` file * they are still printed out on the console when running with `--show-extractor-output`.
This commit is contained in:
@@ -1,10 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
export RUST_BACKTRACE=full
|
export RUST_BACKTRACE=full
|
||||||
QLTEST_LOG="$CODEQL_EXTRACTOR_RUST_LOG_DIR"/qltest.log
|
QLTEST_LOG="$CODEQL_EXTRACTOR_RUST_LOG_DIR"/qltest.log
|
||||||
if ! "$CODEQL_EXTRACTOR_RUST_ROOT/tools/$CODEQL_PLATFORM/extractor" --qltest >> "$QLTEST_LOG" 2>&1; then
|
TMP_OUT="$(mktemp)"
|
||||||
cat "$QLTEST_LOG"
|
trap 'rm -f "$TMP_OUT"' EXIT
|
||||||
|
# put full-color output on the side, but remove the color codes from the log file
|
||||||
|
# also, print (colored) output only in case of failure
|
||||||
|
if ! "$CODEQL_EXTRACTOR_RUST_ROOT/tools/$CODEQL_PLATFORM/extractor" \
|
||||||
|
--qltest \
|
||||||
|
--logging-verbosity=progress+ \
|
||||||
|
2>&1 \
|
||||||
|
| tee "$TMP_OUT" \
|
||||||
|
| sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' \
|
||||||
|
> "$QLTEST_LOG"; then
|
||||||
|
cat "$TMP_OUT"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user