Skip to content

Commit 0911502

Browse files
authored
Merge pull request #1126 from IBM/1125-cloud-pak-deployer-logs-contain-ansi-color-escape-sequences-in-output-files
Fix #1125: Change default log output to plain text without ANSI colors
2 parents 32b5e8d + c54ac91 commit 0911502

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

cp-deploy.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ command_usage() {
5757
echo " --clean-up Remove the container after the run is completed. Remove old images after build. (\$CPD_CLEANUP)"
5858
echo " -v Show standard ansible output (\$ANSIBLE_STANDARD_OUTPUT)"
5959
echo " -vv, -vvv, -vvvv, ... Show verbose ansible output, verbose option used is (number of v)-1 (\$ANSIBLE_VERBOSE)"
60-
echo " --no-color Disable ANSI color codes in the output (\$CPD_NO_COLOR)"
60+
echo " --color Enable ANSI color codes in the output (\$CPD_NO_COLOR)"
6161
echo
6262
echo "Cloud Pak Deployer development options:"
6363
echo " --cpd-develop Map current directory to automation scripts, only for development/debug (\$CPD_DEVELOP)"
@@ -119,7 +119,7 @@ if [ "${CPD_CLEANUP}" == "" ];then CPD_CLEANUP=false;fi
119119
if [ "${CPD_DEVELOP}" == "" ];then CPD_DEVELOP=false;fi
120120
if [ "${CPD_TEST_CARTRIDGES}" == "" ];then CPD_TEST_CARTRIDGES=false;fi
121121
if [ "${CPD_ACCEPT_LICENSES}" == "" ];then CPD_ACCEPT_LICENSES=false;fi
122-
if [ "${CPD_NO_COLOR}" == "" ];then CPD_NO_COLOR=false;fi
122+
if [ "${CPD_NO_COLOR}" == "" ];then CPD_NO_COLOR=true;fi
123123
if [ "${CPD_WIZARD_LOG_LEVEL}" == "" ];then CPD_WIZARD_LOG_LEVEL=INFO;fi
124124

125125
# Check if the command is running inside a container. This means that the command should not start docker or podman
@@ -513,8 +513,8 @@ while (( "$#" )); do
513513
export CPD_SKIP_INFRA=true
514514
shift 1
515515
;;
516-
--no-color)
517-
export CPD_NO_COLOR=true
516+
--color)
517+
export CPD_NO_COLOR=false
518518
shift 1
519519
;;
520520
--skip-cp-install)

docs/src/10-use-deployer/3-run/existing-openshift.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ cp-deploy.sh env apply --accept-all-licenses
217217

218218
You can also specify extra variables such as `env_id` to override the names of the objects referenced in the `.yaml` configuration files as `{{ env_id }}-xxxx`. For more information about the extra (dynamic) variables, see [advanced configuration](../../../50-advanced/advanced-configuration).
219219

220+
!!! info "Log output format"
221+
By default, the deployer generates clean log files without ANSI color codes, making them easier to read and parse with external tools. If you prefer colored terminal output, you can enable it by adding the `--color` flag to the command.
222+
223+
220224
The `--accept-all-licenses` flag is optional and confirms that you accept all licenses of the installed cartridges and instances. Licenses must be either accepted in the configuration files or at the command line.
221225

222226
When running the command, the container will start as a daemon and the command will tail-follow the logs. You can press Ctrl-C at any time to interrupt the logging but the container will continue to run in the background.

0 commit comments

Comments
 (0)