Skip to content

Commit a7f7f26

Browse files
authored
revert(amplify-provider-awscloudformation): removed cfn logging (#6119)
1 parent 0057f74 commit a7f7f26

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

  • packages/amplify-provider-awscloudformation/src/aws-utils

packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const providerName = require('../constants').ProviderName;
1111
const { formUserAgentParam } = require('./user-agent');
1212
const configurationManager = require('../configuration-manager');
1313
const { stateManager } = require('amplify-cli-core');
14-
const { fileLogger } = require('../utils/aws-logger');
15-
const logger = fileLogger('aws-cfn');
1614

1715
const CFN_MAX_CONCURRENT_REQUEST = 5;
1816
const CFN_POLL_TIME = 5 * 1000; // 5 secs wait to check if new stacks are created by root stack
@@ -59,10 +57,8 @@ class CloudFormation {
5957
self.eventStartTime = new Date();
6058

6159
return new Promise((resolve, reject) => {
62-
logger('cfnModel.createStack', [cfnParentStackParams])();
6360
cfnModel.createStack(cfnParentStackParams, createErr => {
6461
this.readStackEvents(cfnParentStackParams.StackName);
65-
logger('cfnModel.createStack', [cfnParentStackParams])(createErr);
6662
if (createErr) {
6763
context.print.error('An error occurred when creating the CloudFormation stack');
6864
reject(createErr);
@@ -177,9 +173,6 @@ class CloudFormation {
177173

178174
getStackEvents(stackName) {
179175
const self = this;
180-
const describeStackEventsArgs = { StackName: stackName };
181-
const log = logger('getStackEvents.cfnModel.describeStackEvents', [describeStackEventsArgs]);
182-
log();
183176
return this.cfn
184177
.describeStackEvents({ StackName: stackName })
185178
.promise()
@@ -189,7 +182,6 @@ class CloudFormation {
189182
return Promise.resolve(events);
190183
})
191184
.catch(e => {
192-
log(e);
193185
if (e && e.code === 'Throttling') {
194186
return Promise.resolve([]);
195187
}
@@ -231,7 +223,6 @@ class CloudFormation {
231223
Body: fs.createReadStream(filePath),
232224
Key: cfnFile,
233225
};
234-
logger('updateResourceStack.s3.uploadFile', [{ Key: s3Params.cfnFile }])();
235226
return s3.uploadFile(s3Params, false);
236227
})
237228
.then(bucketName => {
@@ -244,7 +235,6 @@ class CloudFormation {
244235
const self = this;
245236
this.eventStartTime = new Date();
246237
return new Promise((resolve, reject) => {
247-
logger('updateResourceStack.describeStack', [cfnStackCheckParams])();
248238
this.describeStack(cfnStackCheckParams)
249239
.then(() => {
250240
const cfnParentStackParams = {
@@ -267,7 +257,6 @@ class CloudFormation {
267257
],
268258
Tags,
269259
};
270-
logger('updateResourceStack.updateStack', [cfnStackCheckParams])();
271260
cfnModel.updateStack(cfnParentStackParams, updateErr => {
272261
self.readStackEvents(stackName);
273262

@@ -303,7 +292,6 @@ class CloudFormation {
303292
};
304293
const projectDetails = this.context.amplify.getProjectDetails();
305294
const { amplifyMeta } = projectDetails;
306-
logger('updateamplifyMetaFileWithStackOutputs.cfn.describeStackResources', [cfnParentStackParams])();
307295
const result = await this.cfn.describeStackResources(cfnParentStackParams).promise();
308296
const resources = result.StackResources.filter(
309297
resource =>
@@ -368,12 +356,9 @@ class CloudFormation {
368356
}
369357

370358
listExports(nextToken = null) {
371-
const log = logger('listExports.cfn.listExports', [{ NextToken: nextToken }]);
372359
return new Promise((resolve, reject) => {
373-
log();
374360
this.cfn.listExports(nextToken ? { NextToken: nextToken } : {}, (err, data) => {
375361
if (err) {
376-
log(err);
377362
reject(err);
378363
} else if (data.NextToken) {
379364
this.listExports(data.NextToken).then(innerExports => resolve([...data.Exports, ...innerExports]));
@@ -386,15 +371,12 @@ class CloudFormation {
386371

387372
describeStack(cfnNestedStackParams, maxTry = 10, timeout = CFN_POLL_TIME) {
388373
const cfnModel = this.cfn;
389-
const log = logger('describeStack.cfn.describeStacks', [cfnNestedStackParams]);
390374
return new Promise((resolve, reject) => {
391-
log();
392375
cfnModel
393376
.describeStacks(cfnNestedStackParams)
394377
.promise()
395378
.then(result => resolve(result))
396379
.catch(e => {
397-
log(e);
398380
if (e.code === 'Throttling' && e.retryable) {
399381
setTimeout(() => {
400382
resolve(this.describeStack(cfnNestedStackParams, maxTry - 1, timeout));
@@ -419,10 +401,8 @@ class CloudFormation {
419401
};
420402

421403
const cfnModel = this.cfn;
422-
const log = logger('deleteResourceStack.cfn.describeStacks', [cfnStackParams]);
423404

424405
return new Promise((resolve, reject) => {
425-
log();
426406
cfnModel.describeStacks(cfnStackParams, (err, data) => {
427407
const cfnDeleteStatus = 'stackDeleteComplete';
428408
if (
@@ -448,7 +428,6 @@ class CloudFormation {
448428
});
449429
});
450430
} else {
451-
log(err);
452431
reject(err);
453432
}
454433
});

0 commit comments

Comments
 (0)