Skip to content

Commit c698394

Browse files
committed
Add debug logs when DEBUG=1
1 parent 0a8cce7 commit c698394

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/cdklocal

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const EDGE_PORT = process.env.EDGE_PORT || DEFAULT_EDGE_PORT;
1818
const DEFAULT_HOSTNAME = "localhost";
1919
const LAMBDA_MOUNT_CODE = isEnvTrue("LAMBDA_MOUNT_CODE");
2020
const PROTOCOL = isEnvTrue("USE_SSL") ? "https" : "http";
21+
const DEBUG_ON = process.env.DEBUG === "1";
2122

2223

2324
//----------------
@@ -209,7 +210,10 @@ const patchToolkitInfo = (ToolkitInfo) => {
209210
} = require("aws-cdk/lib/api/bootstrap/bootstrap-props");
210211

211212
const setBucketUrl = function setBucketUrl(object, bucket, domain) {
212-
console.debug("New bucketUrl", `https://${domain.replace(`${bucket}.`, "")}:${EDGE_PORT}/${bucket}`);
213+
if (DEBUG_ON) {
214+
console.debug("Old bucketUrl:", object.bucketUrl);
215+
console.debug("New bucketUrl:", `https://${domain.replace(`${bucket}.`, "")}:${EDGE_PORT}/${bucket}`);
216+
}
213217
Object.defineProperty(object, "bucketUrl", {
214218
get() {
215219
return `https://${domain.replace(`${bucket}.`, "")}:${EDGE_PORT}/${bucket}`;

0 commit comments

Comments
 (0)