Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip escape codes out of logs #2742

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions provision/provision-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ function log_to_file() {
exec 2>&7
# pipe to file
if [[ "${1}" == "provisioner-main" ]]; then
exec > >( tee -a "${logfile}" ) # main provisioner outputs everything
exec > >( tee -a "${logfile}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" ) # main provisioner outputs everything
else
exec > >( tee -a "${logfile}" >/dev/null ) # others, only stderr
exec > >( tee -a "${logfile}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" >/dev/null ) # others, only stderr
fi
exec 2> >( tee -a "${logfile}" >&2 )
exec 2> >( tee -a "${logfile}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" >&2 )
VVV_CURRENT_LOG_FILE="${logfile}"
}
export -f log_to_file
Expand Down