Skip to content

Commit

Permalink
refactor(CLI): Minor modern logs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrzesik committed Oct 8, 2021
1 parent 519d091 commit 39c09e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -2,6 +2,7 @@

const BbPromise = require('bluebird');
const _ = require('lodash');
const { legacy, log } = require('@serverless/utils/log');

module.exports = {
async disassociateUsagePlan() {
Expand All @@ -10,7 +11,8 @@ module.exports = {
this.serverless.service.provider.apiKeys;

if (apiKeys && apiKeys.length) {
this.serverless.cli.log('Removing usage plan association...');
legacy.log('Removing usage plan association...');
log.info('Removing usage plan association');
const stackName = `${this.provider.naming.getStackName()}`;
return BbPromise.all([
this.provider.request('CloudFormation', 'describeStackResource', {
Expand Down
8 changes: 5 additions & 3 deletions lib/plugins/aws/package/compile/functions.js
Expand Up @@ -6,11 +6,12 @@ const crypto = require('crypto');
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const log = require('@serverless/utils/log');
const oldLog = require('@serverless/utils/log');
const ServerlessError = require('../../../../serverless-error');
const deepSortObjectByKey = require('../../../../utils/deepSortObjectByKey');
const getHashForFilePath = require('../lib/getHashForFilePath');
const parseS3URI = require('../../utils/parse-s3-uri');
const { legacy, log } = require('@serverless/utils/log');

class AwsCompileFunctions {
constructor(serverless, options) {
Expand Down Expand Up @@ -120,8 +121,9 @@ class AwsCompileFunctions {
const s3Object = parseS3URI(artifactFilePath);
if (!s3Object) return;
if (process.env.SLS_DEBUG) {
this.serverless.cli.log(`Downloading ${s3Object.Key} from bucket ${s3Object.Bucket}`);
legacy.log(`Downloading ${s3Object.Key} from bucket ${s3Object.Bucket}`);
}
log.info(`Downloading ${s3Object.Key} from bucket ${s3Object.Bucket}`);
await new Promise((resolve, reject) => {
const tmpDir = this.serverless.utils.getTmpDirPath();
const filePath = path.join(tmpDir, path.basename(s3Object.Key));
Expand Down Expand Up @@ -743,7 +745,7 @@ function extractLayerConfigurationsFromFunction(functionProperties, cfTemplate)

if (!configuration) {
if (process.env.SLS_DEBUG) {
log(`Could not find reference to layer: ${potentialLocalLayerObject.Ref}.`);
oldLog(`Could not find reference to layer: ${potentialLocalLayerObject.Ref}.`);
}
return;
}
Expand Down

0 comments on commit 39c09e4

Please sign in to comment.