Skip to content

Commit

Permalink
only turn on logging when env is set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
anubhavmishra committed Jul 3, 2020
1 parent 160bffc commit d11afda
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cdktf-cli/bin/cdktf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const args = yargs
.epilogue(`Options can be specified via environment variables with the "CDKTF_" prefix (e.g. "CDKTF_OUTPUT")`)
.help()
.alias('h', 'help')
.option('disable-logging', { type: 'boolean', default: false, required: false, desc: 'Dont write log files'})
.option('disable-logging', { type: 'boolean', default: true, required: false, desc: 'Dont write log files. Supported using the env CDKTF_DISABLE_LOGGING.'})
.option('log-level', { type: 'string', required: false, desc: 'Which log level should be written. Only supported via setting the env CDKTF_LOG_LEVEL'})
.argv;

Expand Down
2 changes: 1 addition & 1 deletion packages/cdktf-cli/lib/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const logger = getLogger();

logger.level = process.env.CDKTF_LOG_LEVEL || 'INFO';

if (process.env.CDKTF_DISABLE_LOGGING === undefined) {
if (process.env.CDKTF_DISABLE_LOGGING === 'false') {
configure({
appenders: { cdktf: { type: "file", filename: "./cdktf.log" } },
categories: { default: { appenders: ["cdktf"], level: "debug" } }
Expand Down
1 change: 0 additions & 1 deletion test/run-against-dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -euo pipefail
scriptdir=$(cd $(dirname $0) && pwd)

export CDKTF_DIST="${scriptdir}/../dist"
export CDKTF_DISABLE_LOGGING=1
cwd=$PWD

cd ${CDKTF_DIST}
Expand Down

0 comments on commit d11afda

Please sign in to comment.