mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
refactor(CLI): Adapt logInfo to modern logs
This commit is contained in:
parent
d43298d25b
commit
771f99b18d
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const logInfo = require('./Error').logInfo;
|
||||
const { log } = require('@serverless/utils/log');
|
||||
|
||||
const constants = {
|
||||
pending: 'pending',
|
||||
@ -38,6 +39,19 @@ class PromiseTracker {
|
||||
])
|
||||
.join('\n ')
|
||||
);
|
||||
log.info(
|
||||
[
|
||||
'############################################################################################',
|
||||
`# ${delta}: ${this.getSettled().length} of ${this.getAll().length} promises have settled`,
|
||||
`# ${delta}: ${pending.length} are taking longer than expected:`,
|
||||
]
|
||||
.concat(pending.map((promise) => `# ${delta}: ${promise.waitList}`))
|
||||
.concat([
|
||||
'# This can result from latent connections but may represent a cyclic variable dependency',
|
||||
'##########################################################################################',
|
||||
])
|
||||
.join('\n ')
|
||||
);
|
||||
this.reported = true;
|
||||
}
|
||||
stop() {
|
||||
@ -54,6 +68,17 @@ class PromiseTracker {
|
||||
'##########################################################################################',
|
||||
].join('\n ')
|
||||
);
|
||||
log.info(
|
||||
[
|
||||
'############################################################################################',
|
||||
`# Completed after ${Date.now() - this.startTime}ms`,
|
||||
`# ${this.getAll().length} promises are in the following states:`,
|
||||
`# ${constants.resolved}: ${this.getResolved().length}`,
|
||||
`# ${constants.rejected}: ${this.getRejected().length}`,
|
||||
`# ${constants.pending}: ${this.getPending().length}`,
|
||||
'##########################################################################################',
|
||||
].join('\n ')
|
||||
);
|
||||
}
|
||||
this.reset();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user