mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
refactor(CLI): Improve handling of service outputs in modern logs
This commit is contained in:
parent
f4163d2571
commit
7d19ca8572
@ -24,6 +24,13 @@ module.exports = {
|
||||
}
|
||||
|
||||
legacy.consoleLog(message);
|
||||
if (this.serverless.processedInput.commands.join(' ') === 'info') {
|
||||
this.serverless.addServiceOutputSection('service', this.serverless.service.service);
|
||||
this.serverless.addServiceOutputSection('stage', this.provider.getStage());
|
||||
this.serverless.addServiceOutputSection('region', this.provider.getRegion());
|
||||
this.serverless.addServiceOutputSection('stack', this.provider.naming.getStackName());
|
||||
}
|
||||
|
||||
return message;
|
||||
},
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const BbPromise = require('bluebird');
|
||||
const { progress, writeText, style } = require('@serverless/utils/log');
|
||||
const { progress, style } = require('@serverless/utils/log');
|
||||
const writeServiceOutputs = require('../../../cli/write-service-outputs');
|
||||
const validate = require('../lib/validate');
|
||||
const getStackInfo = require('./getStackInfo');
|
||||
@ -87,13 +87,6 @@ class AwsInfo {
|
||||
|
||||
'finalize': () => {
|
||||
if (this.serverless.processedInput.commands.join(' ') !== 'info') return;
|
||||
|
||||
writeText(
|
||||
`${style.aside('service:')} ${this.serverless.service.service}`,
|
||||
`${style.aside('stage:')} ${this.provider.getStage()}`,
|
||||
`${style.aside('region:')} ${this.provider.getRegion()}`,
|
||||
`${style.aside('stack:')} ${this.provider.naming.getStackName()}`
|
||||
);
|
||||
writeServiceOutputs(this.serverless.serviceOutputs);
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user